mfd: sec-core: Cleanup formatting to a consistent style
Subsystems (3)
Krzysztof Kozlowski
maintainerPATCH 1/2 mfd: sec-core: Cleanup formatting to a consistent style
Cleanup the formatting to have consistent style across the file (only white-space issues). No expected difference in code.
--- drivers/mfd/sec-core.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/mfd/sec-core.c +10 -7
@@ -70,9 +70,11 @@ static const struct mfd_cell s2mps11_devs[] = { };static const struct mfd_cell s2mps13_devs[] = { - { .name ="s2mps13-regulator" , }, - { .name ="s2mps13-rtc" , }, { + .name ="s2mps13-regulator" , + }, { + .name ="s2mps13-rtc" , + }, { .name ="s2mps13-clk" , .of_compatible ="samsung,s2mps13-clk" , },
@@ -114,7 +116,8 @@ static const struct mfd_cell s2mpu02_devs[] = { #ifdef CONFIG_OF static const struct of_device_id sec_dt_match[] = { - { .compatible = "samsung,s5m8767-pmic", + { + .compatible = "samsung,s5m8767-pmic", .data = (void *)S5M8767X, }, { .compatible = "samsung,s2mps11-pmic",
@@ -309,8 +312,8 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)* the sub-modules need not instantiate another instance while parsing their * platform data. */ -static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata ( -struct device *dev) +static struct sec_platform_data * +sec_pmic_i2c_parse_dt_pdata (struct device *dev) {struct sec_platform_data *pd;
@@ -331,8 +334,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( return pd; }#else -static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata ( -struct device *dev) +static struct sec_platform_data * +sec_pmic_i2c_parse_dt_pdata (struct device *dev) {return NULL ; }
Signature · 1 line
2.7.4
Krzysztof Kozlowski
maintainerPATCH 2/2 mfd: sec-core: Return gracefully instead of BUG() if device cannot match
Replace impossible BUG() in probe with a proper return. This can be triggered only in case of a clear bug (e.g. adding broken half-support for new S2MPSXX flavor) but BUG() is discouraged and the boot process can actually try to continue.
--- drivers/mfd/sec-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mfd/sec-core.c +3 -2
@@ -474,8 +474,9 @@ static int sec_pmic_probe(struct i2c_client *i2c, num_sec_devs =ARRAY_SIZE (s2mpu02_devs);break ;default : -/* If this happens the probe function is problem */ -BUG (); +dev_err (&i2c->dev,"Unsupported device type (%lu)\n" , + sec_pmic->device_type); +return -ENODEV ; } ret =devm_mfd_add_devices (sec_pmic->dev,-1 , sec_devs, num_sec_devs,NULL ,0 ,NULL );
Signature · 1 line
2.7.4
Lee Jones
AppliedRe: [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match
Quoted 9 lines · Krzysztof Kozlowski
Replace impossible
BUG()in probe with a proper return. This can be triggered only in case of a clear bug (e.g. adding broken half-support for new S2MPSXX flavor) butBUG()is discouraged and the boot process can actually try to continue.Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/mfd/sec-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 13 lines · Krzysztof Kozlowski
Cleanup the formatting to have consistent style across the file (only white-space issues). No expected difference in code.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/mfd/sec-core.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)drivers/mfd/sec-core.c +0
-0
drivers/mfd/sec-core.c static const struct mfd_cell s2mps11_devs[] = { · line 74
Quoted 5 lines
drivers/mfd/sec-core.c +0
-2@@ -70,9 +70,11 @@ static const struct mfd_cell s2mps11_devs[] = { };static const struct mfd_cell s2mps13_devs[] = { - { .name ="s2mps13-regulator" , }, - { .name ="s2mps13-rtc" , },
I prefer one liners to remain on one line.
Quoted 9 lines
drivers/mfd/sec-core.c +4
-0{ + .name = "s2mps13-regulator", + }, { + .name = "s2mps13-rtc", + }, { .name = "s2mps13-clk", .of_compatible = "samsung,s2mps13-clk", },
drivers/mfd/sec-core.c static const struct mfd_cell s2mpu02_devs[] = { · line 121
Quoted 7 lines
drivers/mfd/sec-core.c +2
-1@@ -114,7 +116,8 @@ static const struct mfd_cell s2mpu02_devs[] = { #ifdef CONFIG_OF static const struct of_device_id sec_dt_match[] = { - { .compatible = "samsung,s5m8767-pmic", + { + .compatible = "samsung,s5m8767-pmic", .data = (void *)S5M8767X,
All of the other changes are fine.
Quoted 24 lines
drivers/mfd/sec-core.c +4
-4}, { .compatible = "samsung,s2mps11-pmic",@@ -309,8 +312,8 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)* the sub-modules need not instantiate another instance while parsing their * platform data. */ -static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata ( -struct device *dev) +static struct sec_platform_data * +sec_pmic_i2c_parse_dt_pdata (struct device *dev) {struct sec_platform_data *pd;@@ -331,8 +334,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata( return pd; }#else -static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata ( -struct device *dev) +static struct sec_platform_data * +sec_pmic_i2c_parse_dt_pdata (struct device *dev) {return NULL ; }
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Krzysztof Kozlowski
maintainerQuoted 18 lines · Lee Jones
Quoted 15 lines · Krzysztof Kozlowski
Cleanup the formatting to have consistent style across the file (only white-space issues). No expected difference in code.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/mfd/sec-core.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)drivers/mfd/sec-core.c +0
-0@@ -70,9 +70,11 @@ static const struct mfd_cell s2mps11_devs[] = { };
Quoted 5 lines
drivers/mfd/sec-core.c static const struct mfd_cell s2mps11_devs[] = { · line 74
Quoted 3 lines
drivers/mfd/sec-core.c +0
-2static const struct mfd_cell s2mps13_devs[] = { - { .name ="s2mps13-regulator" , }, - { .name ="s2mps13-rtc" , },I prefer one liners to remain on one line.
OK
Quoted 11 lines
Quoted 11 lines
drivers/mfd/sec-core.c +4
-0{ + .name = "s2mps13-regulator", + }, { + .name = "s2mps13-rtc", + }, { .name = "s2mps13-clk", .of_compatible = "samsung,s2mps13-clk", },@@ -114,7 +116,8 @@ static const struct mfd_cell s2mpu02_devs[] = {
Quoted 8 lines
drivers/mfd/sec-core.c static const struct mfd_cell s2mpu02_devs[] = { · line 121
Quoted 6 lines
drivers/mfd/sec-core.c +2
-1#ifdef CONFIG_OF static const struct of_device_id sec_dt_match[] = { - { .compatible = "samsung,s5m8767-pmic", + { + .compatible = "samsung,s5m8767-pmic", .data = (void *)S5M8767X,All of the other changes are fine.
OK, let me send v2.
Best regards,
Krzysztof