* [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style
@ 2019-01-29 11:25 Krzysztof Kozlowski
2019-01-29 11:25 ` [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match Krzysztof Kozlowski
2019-02-01 9:21 ` [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Lee Jones
0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2019-01-29 11:25 UTC (permalink / raw)
To: Sangbeom Kim, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
Lee Jones, linux-kernel, linux-samsung-soc
Cleanup the formatting to have consistent style across the file (only
white-space issues). No expected difference in code.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/mfd/sec-core.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index e0835c9df7a1..c3bb53f79e63 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match
2019-01-29 11:25 [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Krzysztof Kozlowski
@ 2019-01-29 11:25 ` Krzysztof Kozlowski
2019-02-01 9:22 ` Lee Jones
2019-02-01 9:21 ` [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Lee Jones
1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2019-01-29 11:25 UTC (permalink / raw)
To: Sangbeom Kim, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
Lee Jones, linux-kernel, linux-samsung-soc
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.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/mfd/sec-core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index c3bb53f79e63..2c2f48b24eeb 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -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);
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style
2019-01-29 11:25 [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Krzysztof Kozlowski
2019-01-29 11:25 ` [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match Krzysztof Kozlowski
@ 2019-02-01 9:21 ` Lee Jones
2019-02-11 13:14 ` Krzysztof Kozlowski
1 sibling, 1 reply; 5+ messages in thread
From: Lee Jones @ 2019-02-01 9:21 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, linux-kernel, linux-samsung-soc
On Tue, 29 Jan 2019, Krzysztof Kozlowski wrote:
> Cleanup the formatting to have consistent style across the file (only
> white-space issues). No expected difference in code.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> drivers/mfd/sec-core.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index e0835c9df7a1..c3bb53f79e63 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -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.
> {
> + .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,
All of the other changes are fine.
> }, {
> .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;
> }
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match
2019-01-29 11:25 ` [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match Krzysztof Kozlowski
@ 2019-02-01 9:22 ` Lee Jones
0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2019-02-01 9:22 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, linux-kernel, linux-samsung-soc
On Tue, 29 Jan 2019, Krzysztof Kozlowski wrote:
> 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.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> drivers/mfd/sec-core.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style
2019-02-01 9:21 ` [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Lee Jones
@ 2019-02-11 13:14 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2019-02-11 13:14 UTC (permalink / raw)
To: Lee Jones
Cc: Sangbeom Kim, Bartlomiej Zolnierkiewicz, linux-kernel, linux-samsung-soc
On Fri, 1 Feb 2019 at 10:21, Lee Jones <lee.jones@linaro.org> wrote:
>
> On Tue, 29 Jan 2019, Krzysztof Kozlowski wrote:
>
> > Cleanup the formatting to have consistent style across the file (only
> > white-space issues). No expected difference in code.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> > drivers/mfd/sec-core.c | 17 ++++++++++-------
> > 1 file changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> > index e0835c9df7a1..c3bb53f79e63 100644
> > --- a/drivers/mfd/sec-core.c
> > +++ b/drivers/mfd/sec-core.c
> > @@ -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.
OK
>
> > {
> > + .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,
>
> All of the other changes are fine.
OK, let me send v2.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-02-11 13:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 11:25 [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Krzysztof Kozlowski
2019-01-29 11:25 ` [PATCH 2/2] mfd: sec-core: Return gracefully instead of BUG() if device cannot match Krzysztof Kozlowski
2019-02-01 9:22 ` Lee Jones
2019-02-01 9:21 ` [PATCH 1/2] mfd: sec-core: Cleanup formatting to a consistent style Lee Jones
2019-02-11 13:14 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).