linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: mt6360: Sort regulator resources
@ 2021-06-29  9:43 Fei Shao
  2021-06-29  9:43 ` [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure Fei Shao
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fei Shao @ 2021-06-29  9:43 UTC (permalink / raw)
  To: lee.jones
  Cc: Fei Shao, Gene Chen, Matthias Brugger, linux-arm-kernel,
	linux-kernel, linux-mediatek

Reorder the regulator resources.

Fixes: 4ee06e10dd26 ("mfd: mt6360: Combine mt6360 pmic/ldo resources
into mt6360 regulator resources")

Signed-off-by: Fei Shao <fshao@chromium.org>
---

 drivers/mfd/mt6360-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
index e628953548ce..6eaa6775b888 100644
--- a/drivers/mfd/mt6360-core.c
+++ b/drivers/mfd/mt6360-core.c
@@ -319,18 +319,18 @@ static const struct resource mt6360_regulator_resources[] = {
 	DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_OC_EVT, "buck2_oc_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_OV_EVT, "buck2_ov_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_UV_EVT, "buck2_uv_evt"),
-	DEFINE_RES_IRQ_NAMED(MT6360_LDO6_OC_EVT, "ldo6_oc_evt"),
-	DEFINE_RES_IRQ_NAMED(MT6360_LDO7_OC_EVT, "ldo7_oc_evt"),
-	DEFINE_RES_IRQ_NAMED(MT6360_LDO6_PGB_EVT, "ldo6_pgb_evt"),
-	DEFINE_RES_IRQ_NAMED(MT6360_LDO7_PGB_EVT, "ldo7_pgb_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO1_OC_EVT, "ldo1_oc_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO2_OC_EVT, "ldo2_oc_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO3_OC_EVT, "ldo3_oc_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO5_OC_EVT, "ldo5_oc_evt"),
+	DEFINE_RES_IRQ_NAMED(MT6360_LDO6_OC_EVT, "ldo6_oc_evt"),
+	DEFINE_RES_IRQ_NAMED(MT6360_LDO7_OC_EVT, "ldo7_oc_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO1_PGB_EVT, "ldo1_pgb_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO2_PGB_EVT, "ldo2_pgb_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO3_PGB_EVT, "ldo3_pgb_evt"),
 	DEFINE_RES_IRQ_NAMED(MT6360_LDO5_PGB_EVT, "ldo5_pgb_evt"),
+	DEFINE_RES_IRQ_NAMED(MT6360_LDO6_PGB_EVT, "ldo6_pgb_evt"),
+	DEFINE_RES_IRQ_NAMED(MT6360_LDO7_PGB_EVT, "ldo7_pgb_evt"),
 };

 static const struct mfd_cell mt6360_devs[] = {
--
2.32.0.93.g670b81a890-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure
  2021-06-29  9:43 [PATCH 1/2] mfd: mt6360: Sort regulator resources Fei Shao
@ 2021-06-29  9:43 ` Fei Shao
  2021-07-02  4:52   ` Tzung-Bi Shih
  2021-07-16  8:03   ` Lee Jones
  2021-07-02  4:52 ` [PATCH 1/2] mfd: mt6360: Sort regulator resources Tzung-Bi Shih
  2021-07-16  8:01 ` Lee Jones
  2 siblings, 2 replies; 7+ messages in thread
From: Fei Shao @ 2021-06-29  9:43 UTC (permalink / raw)
  To: lee.jones
  Cc: Fei Shao, Gene Chen, Matthias Brugger, linux-arm-kernel,
	linux-kernel, linux-mediatek

This adds back a missing error message for better log readability.

Fixes: e84702940613 ("mfd: mt6360: Fix flow which is used to check ic
exist")

Signed-off-by: Fei Shao <fshao@chromium.org>
---

 drivers/mfd/mt6360-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
index 6eaa6775b888..0ff8dae4536c 100644
--- a/drivers/mfd/mt6360-core.c
+++ b/drivers/mfd/mt6360-core.c
@@ -351,8 +351,10 @@ static int mt6360_check_vendor_info(struct mt6360_ddata *ddata)
 	int ret;
 
 	ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, &info);
-	if (ret < 0)
+	if (ret < 0) {
+		dev_err(ddata->dev, "Failed to read device info from regmap\n");
 		return ret;
+	}
 
 	if ((info & CHIP_VEN_MASK) != CHIP_VEN_MT6360) {
 		dev_err(ddata->dev, "Device not supported\n");
-- 
2.32.0.93.g670b81a890-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] mfd: mt6360: Sort regulator resources
  2021-06-29  9:43 [PATCH 1/2] mfd: mt6360: Sort regulator resources Fei Shao
  2021-06-29  9:43 ` [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure Fei Shao
@ 2021-07-02  4:52 ` Tzung-Bi Shih
  2021-07-16  8:01 ` Lee Jones
  2 siblings, 0 replies; 7+ messages in thread
From: Tzung-Bi Shih @ 2021-07-02  4:52 UTC (permalink / raw)
  To: Fei Shao
  Cc: lee.jones, Gene Chen, Matthias Brugger, linux-arm-kernel,
	linux-kernel, linux-mediatek

On Tue, Jun 29, 2021 at 5:44 PM Fei Shao <fshao@chromium.org> wrote:
> Reorder the regulator resources.
Would be better to mention the list is sorted by their IRQ number.

> Fixes: 4ee06e10dd26 ("mfd: mt6360: Combine mt6360 pmic/ldo resources
> into mt6360 regulator resources")
It doesn't need to be a fixup for 4ee06e10dd26 but a follow up cleanup.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure
  2021-06-29  9:43 ` [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure Fei Shao
@ 2021-07-02  4:52   ` Tzung-Bi Shih
  2021-07-16  8:03   ` Lee Jones
  1 sibling, 0 replies; 7+ messages in thread
From: Tzung-Bi Shih @ 2021-07-02  4:52 UTC (permalink / raw)
  To: Fei Shao
  Cc: lee.jones, Gene Chen, Matthias Brugger, linux-arm-kernel,
	linux-kernel, linux-mediatek

On Tue, Jun 29, 2021 at 5:44 PM Fei Shao <fshao@chromium.org> wrote:
> This adds back a missing error message for better log readability.

I have no preference for the patch.  When the regmap_read() fails,
mt6360 will fail to probe and return the errno anyway.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] mfd: mt6360: Sort regulator resources
  2021-06-29  9:43 [PATCH 1/2] mfd: mt6360: Sort regulator resources Fei Shao
  2021-06-29  9:43 ` [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure Fei Shao
  2021-07-02  4:52 ` [PATCH 1/2] mfd: mt6360: Sort regulator resources Tzung-Bi Shih
@ 2021-07-16  8:01 ` Lee Jones
  2 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2021-07-16  8:01 UTC (permalink / raw)
  To: Fei Shao
  Cc: Gene Chen, Matthias Brugger, linux-arm-kernel, linux-kernel,
	linux-mediatek

On Tue, 29 Jun 2021, Fei Shao wrote:

> Reorder the regulator resources.
> 
> Fixes: 4ee06e10dd26 ("mfd: mt6360: Combine mt6360 pmic/ldo resources
> into mt6360 regulator resources")

I removed the Fixes tag, as it doesn't fix any bugs.

> Signed-off-by: Fei Shao <fshao@chromium.org>
> ---
> 
>  drivers/mfd/mt6360-core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure
  2021-06-29  9:43 ` [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure Fei Shao
  2021-07-02  4:52   ` Tzung-Bi Shih
@ 2021-07-16  8:03   ` Lee Jones
  2021-07-16 10:23     ` Fei Shao
  1 sibling, 1 reply; 7+ messages in thread
From: Lee Jones @ 2021-07-16  8:03 UTC (permalink / raw)
  To: Fei Shao
  Cc: Gene Chen, Matthias Brugger, linux-arm-kernel, linux-kernel,
	linux-mediatek

On Tue, 29 Jun 2021, Fei Shao wrote:

> This adds back a missing error message for better log readability.
> 
> Fixes: e84702940613 ("mfd: mt6360: Fix flow which is used to check ic
> exist")
> 
> Signed-off-by: Fei Shao <fshao@chromium.org>
> ---
> 
>  drivers/mfd/mt6360-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
> index 6eaa6775b888..0ff8dae4536c 100644
> --- a/drivers/mfd/mt6360-core.c
> +++ b/drivers/mfd/mt6360-core.c
> @@ -351,8 +351,10 @@ static int mt6360_check_vendor_info(struct mt6360_ddata *ddata)
>  	int ret;
>  
>  	ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, &info);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		dev_err(ddata->dev, "Failed to read device info from regmap\n");

I'm not fussed about this change either, but if you insist, please
change the commit message to be a little more generic.  Users don't
care about Regmaps and developers can grep it in the source.

Suggest: "Failed to fetch device information from H/W"

>  		return ret;
> +	}
>  
>  	if ((info & CHIP_VEN_MASK) != CHIP_VEN_MT6360) {
>  		dev_err(ddata->dev, "Device not supported\n");

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure
  2021-07-16  8:03   ` Lee Jones
@ 2021-07-16 10:23     ` Fei Shao
  0 siblings, 0 replies; 7+ messages in thread
From: Fei Shao @ 2021-07-16 10:23 UTC (permalink / raw)
  To: Lee Jones
  Cc: Gene Chen, Matthias Brugger, linux-arm-kernel, linux-kernel,
	linux-mediatek

On Fri, Jul 16, 2021 at 4:03 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Tue, 29 Jun 2021, Fei Shao wrote:
>
> > This adds back a missing error message for better log readability.
> >
> > Fixes: e84702940613 ("mfd: mt6360: Fix flow which is used to check ic
> > exist")
> >
> > Signed-off-by: Fei Shao <fshao@chromium.org>
> > ---
> >
> >  drivers/mfd/mt6360-core.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
> > index 6eaa6775b888..0ff8dae4536c 100644
> > --- a/drivers/mfd/mt6360-core.c
> > +++ b/drivers/mfd/mt6360-core.c
> > @@ -351,8 +351,10 @@ static int mt6360_check_vendor_info(struct mt6360_ddata *ddata)
> >       int ret;
> >
> >       ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, &info);
> > -     if (ret < 0)
> > +     if (ret < 0) {
> > +             dev_err(ddata->dev, "Failed to read device info from regmap\n");
>
> I'm not fussed about this change either, but if you insist, please
> change the commit message to be a little more generic.  Users don't
> care about Regmaps and developers can grep it in the source.
>
> Suggest: "Failed to fetch device information from H/W"

I think I was a bit too paranoid about this. Please ignore this as it
doesn't make much sense, and thanks both of you for the feedback. :)

Fei

>
> >               return ret;
> > +     }
> >
> >       if ((info & CHIP_VEN_MASK) != CHIP_VEN_MT6360) {
> >               dev_err(ddata->dev, "Device not supported\n");
>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-16 10:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  9:43 [PATCH 1/2] mfd: mt6360: Sort regulator resources Fei Shao
2021-06-29  9:43 ` [PATCH 2/2] mfd: mt6360: Restore error message to regmap_read failure Fei Shao
2021-07-02  4:52   ` Tzung-Bi Shih
2021-07-16  8:03   ` Lee Jones
2021-07-16 10:23     ` Fei Shao
2021-07-02  4:52 ` [PATCH 1/2] mfd: mt6360: Sort regulator resources Tzung-Bi Shih
2021-07-16  8:01 ` Lee Jones

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).