lkml.org 
[lkml]   [2020]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] Revert "net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()"
Date
> -----Original Message-----
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Sent: Friday, September 25, 2020 17:44
> To: Liu, Yongxin <Yongxin.Liu@windriver.com>
> Cc: David S . Miller <davem@davemloft.net>; netdev
> <netdev@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH] Revert "net: ethernet: ixgbe: check the return value
> of ixgbe_mii_bus_init()"
>
> On Fri, Sep 25, 2020 at 10:51 AM Liu, Yongxin <Yongxin.Liu@windriver.com>
> wrote:
> >
>
> [snip]
>
> > > > true);
> > > >
> > > > - err = ixgbe_mii_bus_init(hw);
> > > > - if (err)
> > > > - goto err_netdev;
> > > > + ixgbe_mii_bus_init(hw);
> > > >
> > > > return 0;
> > > >
> > > > -err_netdev:
> > > > - unregister_netdev(netdev);
> > > > err_register:
> > > > ixgbe_release_hw_control(adapter);
> > > > ixgbe_clear_interrupt_scheme(adapter);
> > > > --
> > > > 2.14.4
> > > >
> > >
> > > Then we should check if err == -ENODEV, not outright ignore all
> > > potential errors, right?
> > >
> >
> > Hm, it is weird to take -ENODEV as a no error.
> > How about just return 0 instead of -ENODEV in the following function?
> >
>
> No, it's perfectly fine. -ENODEV means there's no device and this can
> happen. The caller can then act accordingly - for example: ignore that
> fact. We do it in several places[1].
>
> Bartosz
>
> [snip]
>
> [1]
> https://elixir.bootlin.com/linux/latest/source/drivers/misc/eeprom/at24.c#
> L714


Okay, please go ahead and fix this issue.


Thanks,
Yongxin
\
 
 \ /
  Last update: 2020-09-27 01:28    [W:0.062 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site