linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v1 3/3] gpiolib: Move gpiodevice_*() to gpiodev namespace
Date: Thu, 9 Mar 2023 20:52:43 +0200	[thread overview]
Message-ID: <ZAoq+yAyPnI4zgto@smile.fi.intel.com> (raw)
In-Reply-To: <CAMRc=MdW7JjWvJUtvwJDwWLB5ygPiCRWLNM8E0iyRoD=HbzfVw@mail.gmail.com>

On Wed, Mar 08, 2023 at 11:49:53AM +0100, Bartosz Golaszewski wrote:
> On Tue, Mar 7, 2023 at 7:25 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > The functions that operates on the same device object would
> > have the same namespace for better code understanding and
> > maintenance.

...

> > -static void gpiodevice_release(struct device *dev)
> > +static void gpiodev_release(struct device *dev)
> >  {
> >         struct gpio_device *gdev = to_gpio_device(dev);
> >         unsigned long flags;
> > @@ -617,7 +617,7 @@ static int gpiochip_setup_dev(struct gpio_device *gdev)
> >                 return ret;
> >
> >         /* From this point, the .release() function cleans up gpio_device */
> > -       gdev->dev.release = gpiodevice_release;
> > +       gdev->dev.release = gpiodev_release;
> >
> >         ret = gpiochip_sysfs_register(gdev);
> >         if (ret)

> But the only other function that's in the gpiodev_ namespace operates
> on struct gpio_device so that change doesn't make much sense to me.

I'm not sure I understood the comment.
After this change we will have

static int gpiodev_add_to_list(struct gpio_device *gdev)
static void gpiodev_release(struct device *dev)

There are also gpio_device_*() I have noticed, so may be these should be
actually in that namespace?

And we have

static int gpiochip_setup_dev(struct gpio_device *gdev)
static void gpiolib_dbg_show(struct seq_file *s, struct gpio_device *gdev)

That said, what do you think is the best to make this more consistent?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-03-09 18:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 18:25 [PATCH v1 0/3] gpiolib: cleanups WRT GPIO device handling Andy Shevchenko
2023-03-07 18:25 ` [PATCH v1 1/3] gpiolib: Access device's fwnode via dev_fwnode() Andy Shevchenko
2023-03-09 13:58   ` Linus Walleij
2023-03-07 18:25 ` [PATCH v1 2/3] gpiolib: Get rid of gpio_bus_match() forward declaration Andy Shevchenko
2023-03-09 13:58   ` Linus Walleij
2023-03-07 18:25 ` [PATCH v1 3/3] gpiolib: Move gpiodevice_*() to gpiodev namespace Andy Shevchenko
2023-03-08 10:49   ` Bartosz Golaszewski
2023-03-09 18:52     ` Andy Shevchenko [this message]
2023-03-10 16:48       ` Bartosz Golaszewski
2023-03-10 17:01         ` Andy Shevchenko
2023-03-15  9:44           ` Bartosz Golaszewski
2023-03-08 10:50 ` [PATCH v1 0/3] gpiolib: cleanups WRT GPIO device handling Bartosz Golaszewski
2023-03-08 13:01   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAoq+yAyPnI4zgto@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).