diff mbox

phy: fix error handling

Message ID 1467525332-12963-1-git-send-email-christophe.jaillet@wanadoo.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Christophe JAILLET July 3, 2016, 5:55 a.m. UTC
This is likely that checking 'phy->hsic_clk' instead of 'phy->clk' is
expected here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/phy/phy-sun9i-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Ripard July 3, 2016, 8:04 p.m. UTC | #1
On Sun, Jul 03, 2016 at 07:55:32AM +0200, Christophe JAILLET wrote:
> This is likely that checking 'phy->hsic_clk' instead of 'phy->clk' is
> expected here.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime
Christophe JAILLET July 3, 2016, 9:08 p.m. UTC | #2
I will resubmit in the coming days.

    return PTR_ERR(phy->clk);
should also be updated.

Best regards,
CJ

Le 03/07/2016 à 07:55, Christophe JAILLET a écrit :
> This is likely that checking 'phy->hsic_clk' instead of 'phy->clk' is
> expected here.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/phy/phy-sun9i-usb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/phy-sun9i-usb.c b/drivers/phy/phy-sun9i-usb.c
> index ac4f31a..ff99eba 100644
> --- a/drivers/phy/phy-sun9i-usb.c
> +++ b/drivers/phy/phy-sun9i-usb.c
> @@ -141,7 +141,7 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
>   		}
>   
>   		phy->hsic_clk = devm_clk_get(dev, "hsic_12M");
> -		if (IS_ERR(phy->clk)) {
> +		if (IS_ERR(phy->hsic_clk)) {
>   			dev_err(dev, "failed to get hsic_12M clock\n");
>   			return PTR_ERR(phy->clk);
>   		}
Kishon Vijay Abraham I July 4, 2016, 7:52 a.m. UTC | #3
Hi,

On Monday 04 July 2016 02:38 AM, Christophe JAILLET wrote:
> I will resubmit in the coming days.
> 
>    return PTR_ERR(phy->clk);
> should also be updated.

while at that, also fix your $subject to something like
"phy: sun9i-usb: fix error handling"

Thanks
Kishon

> 
> Best regards,
> CJ
> 
> Le 03/07/2016 à 07:55, Christophe JAILLET a écrit :
>> This is likely that checking 'phy->hsic_clk' instead of 'phy->clk' is
>> expected here.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   drivers/phy/phy-sun9i-usb.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/phy-sun9i-usb.c b/drivers/phy/phy-sun9i-usb.c
>> index ac4f31a..ff99eba 100644
>> --- a/drivers/phy/phy-sun9i-usb.c
>> +++ b/drivers/phy/phy-sun9i-usb.c
>> @@ -141,7 +141,7 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
>>           }
>>             phy->hsic_clk = devm_clk_get(dev, "hsic_12M");
>> -        if (IS_ERR(phy->clk)) {
>> +        if (IS_ERR(phy->hsic_clk)) {
>>               dev_err(dev, "failed to get hsic_12M clock\n");
>>               return PTR_ERR(phy->clk);
>>           }
> 
>
Dan Carpenter July 4, 2016, 8:51 a.m. UTC | #4
On Mon, Jul 04, 2016 at 01:22:50PM +0530, Kishon Vijay Abraham I wrote:
> Hi,
> 
> On Monday 04 July 2016 02:38 AM, Christophe JAILLET wrote:
> > I will resubmit in the coming days.
> > 
> >    return PTR_ERR(phy->clk);
> > should also be updated.
> 
> while at that, also fix your $subject to something like
> "phy: sun9i-usb: fix error handling"
> 

Yes.  Also the first patch should have used that same prefix.
9c3b44302636 ('phy: Add driver to support individual USB PHYs on sun9i')

We have this problem quite often, but other subsystems have fixed it
because they start using the correct prefix when the driver is added.
The second patch for this driver had the same issue:
9c3b44302636 ('phy: Add driver to support individual USB PHYs on sun9i')

regards,
dan carpenter
Julia Lawall July 4, 2016, 8:58 a.m. UTC | #5
On Mon, 4 Jul 2016, Dan Carpenter wrote:

> On Mon, Jul 04, 2016 at 01:22:50PM +0530, Kishon Vijay Abraham I wrote:
> > Hi,
> >
> > On Monday 04 July 2016 02:38 AM, Christophe JAILLET wrote:
> > > I will resubmit in the coming days.
> > >
> > >    return PTR_ERR(phy->clk);
> > > should also be updated.
> >
> > while at that, also fix your $subject to something like
> > "phy: sun9i-usb: fix error handling"
> >
>
> Yes.  Also the first patch should have used that same prefix.
> 9c3b44302636 ('phy: Add driver to support individual USB PHYs on sun9i')
>
> We have this problem quite often, but other subsystems have fixed it
> because they start using the correct prefix when the driver is added.
> The second patch for this driver had the same issue:
> 9c3b44302636 ('phy: Add driver to support individual USB PHYs on sun9i')

Is there any hope to some day have a deterministic algorithm?  Something
that get_maintainers could figure out.

julia
diff mbox

Patch

diff --git a/drivers/phy/phy-sun9i-usb.c b/drivers/phy/phy-sun9i-usb.c
index ac4f31a..ff99eba 100644
--- a/drivers/phy/phy-sun9i-usb.c
+++ b/drivers/phy/phy-sun9i-usb.c
@@ -141,7 +141,7 @@  static int sun9i_usb_phy_probe(struct platform_device *pdev)
 		}
 
 		phy->hsic_clk = devm_clk_get(dev, "hsic_12M");
-		if (IS_ERR(phy->clk)) {
+		if (IS_ERR(phy->hsic_clk)) {
 			dev_err(dev, "failed to get hsic_12M clock\n");
 			return PTR_ERR(phy->clk);
 		}