lkml.org 
[lkml]   [2024]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 08/23] gpio: sysfs: use gpio_device_find() to iterate over existing devices
    On Mon, Feb 05, 2024 at 02:39:40PM +0100, Bartosz Golaszewski wrote:
    > On Mon, Feb 5, 2024 at 2:38 PM Andy Shevchenko
    > <andriy.shevchenko@linux.intel.com> wrote:
    > > On Mon, Feb 05, 2024 at 02:19:10PM +0100, Bartosz Golaszewski wrote:
    > > > On Mon, Feb 5, 2024 at 1:36 PM Andy Shevchenko
    > > > <andriy.shevchenko@linux.intel.com> wrote:
    > > > > On Mon, Feb 05, 2024 at 10:34:03AM +0100, Bartosz Golaszewski wrote:

    ..

    > > > > > +static int gpiofind_sysfs_register(struct gpio_chip *gc, void *data)
    > > > > > +{
    > > > > > + struct gpio_device *gdev = gc->gpiodev;
    > > > > > + int ret;
    > > > > > +
    > > > > > + if (gdev->mockdev)
    > > > > > + return 0;
    > > > > > +
    > > > > > + ret = gpiochip_sysfs_register(gdev);
    > > > > > + if (ret)
    > > > > > + chip_err(gc, "failed to register the sysfs entry: %d\n", ret);
    > > > >
    > > > > > + return 0;
    > > > >
    > > > > ???
    > >
    > > What the point of function to be int if you effectively ignore this by always
    > > returning 0?
    > >
    >
    > Because the signature of the callback expects an int to be returned?

    But why do you return 0 instead of ret?

    > > > Not sure what the ... and ??? mean? The commit message should have
    > > > read "... traverse it from gpiofind_sysfs_register()" I agree but the
    > > > latter?
    > >
    > > I didn't realize this may not be obvious :-(.
    > >
    > > > > > +}

    --
    With Best Regards,
    Andy Shevchenko



    \
     
     \ /
      Last update: 2024-05-27 14:49    [W:4.897 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site