[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1278623750.602548.1550097191567@email.ionos.de>
Date: Wed, 13 Feb 2019 23:33:11 +0100 (CET)
From: Stefan Wahren <stefan.wahren@...e.com>
To: Eric Anholt <eric@...olt.net>,
Florian Fainelli <f.fainelli@...il.com>
Cc: linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com
Subject: Re: [PATCH 2/2] soc: bcm: bcm2835-pm: Fix error paths of
initialization.
> Eric Anholt <eric@...olt.net> hat am 13. Februar 2019 um 19:28 geschrieben:
>
>
> Stefan Wahren <stefan.wahren@...e.com> writes:
>
> > Hi Eric,
> >
> > Am 13.02.19 um 01:33 schrieb Eric Anholt:
> >> The clock driver may probe after ours and so we need to pass the
> >> -EPROBE_DEFER out. Fix the other error path while we're here.
> >>
> >> Signed-off-by: Eric Anholt <eric@...olt.net>
> >> Fixes: 670c672608a1 ("soc: bcm: bcm2835-pm: Add support for power domains under a new binding.")
> >> ---
> >> drivers/soc/bcm/bcm2835-power.c | 30 +++++++++++++++++++++++++-----
> >> 1 file changed, 25 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c
> >> index 4a1b99b773c0..11f9469423f7 100644
> >> --- a/drivers/soc/bcm/bcm2835-power.c
> >> +++ b/drivers/soc/bcm/bcm2835-power.c
> >> @@ -485,7 +485,7 @@ static int bcm2835_power_pd_power_off(struct generic_pm_domain *domain)
> >> }
> >> }
> >>
> >> -static void
> >> +static int
> >> bcm2835_init_power_domain(struct bcm2835_power *power,
> >> int pd_xlate_index, const char *name)
> >> {
> >> @@ -493,6 +493,12 @@ bcm2835_init_power_domain(struct bcm2835_power *power,
> >> struct bcm2835_power_domain *dom = &power->domains[pd_xlate_index];
> >>
> >> dom->clk = devm_clk_get(dev->parent, name);
> >> + if (IS_ERR(dom->clk)) {
> >> + int ret = PTR_ERR(dom->clk);
> >> +
> >> + if (ret == -EPROBE_DEFER)
> >> + return ret;
> > is it safe to proceed in the other error cases?
> > Even it would be more consistent with clk_prepare_enable() to print an
> > error here.
>
> Yes, not all domains have a clk, so we want to ignore the other error.
But shouldn't we set dom->clk to NULL instead of keeping the error pointer? AFAIK clk_prepare_enable is aware of NULL instead of error pointer.
> And we shouldn't print for defers, generally.
Sure, i wanted to refer to all the other error cases.
Stefan
Powered by blists - more mailing lists