diff mbox series

[2/2] mfd: mt6360: Restore error message to regmap_read failure

Message ID 20210629094339.874120-2-fshao@chromium.org (mailing list archive)
State New, archived
Headers show
Series [1/2] mfd: mt6360: Sort regulator resources | expand

Commit Message

Fei Shao June 29, 2021, 9:43 a.m. UTC
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(-)

Comments

Tzung-Bi Shih July 2, 2021, 4:52 a.m. UTC | #1
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.
Lee Jones July 16, 2021, 8:03 a.m. UTC | #2
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");
Fei Shao July 16, 2021, 10:23 a.m. UTC | #3
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
diff mbox series

Patch

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");