From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thomas Richard <thomas.richard@bootlin.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Geert Uytterhoeven <geert+renesas@glider.be>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
thomas.petazzoni@bootlin.com, DanieleCleri@aaeon.eu,
GaryWang@aaeon.com.tw
Subject: Re: [PATCH RFC v2 2/6] gpio: aggregator: refactor the forwarder part.
Date: Mon, 17 Mar 2025 19:04:43 +0200 [thread overview]
Message-ID: <Z9hWKxbcHlhyiCmR@smile.fi.intel.com> (raw)
In-Reply-To: <20250317-aaeon-up-board-pinctrl-support-v2-2-36126e30aa62@bootlin.com>
On Mon, Mar 17, 2025 at 04:38:00PM +0100, Thomas Richard wrote:
> Prepare the code to create a gpio-fwd library. This library will allow to
> create and register a gpiochip forwarder.
...
> struct gpiochip_fwd {
> + struct device *dev;
> struct gpio_chip chip;
Have you checked the code generation?
Also, is this new pointer the same as chip.parent?
> struct gpio_desc **descs;
> union {
> };
...
> +static struct gpiochip_fwd *devm_gpiochip_fwd_alloc(struct device *dev,
> + unsigned int ngpios)
I would rather split as
static struct gpiochip_fwd *
devm_gpiochip_fwd_alloc(struct device *dev, unsigned int ngpios)
...
> + fwd->descs = devm_kcalloc(dev, ngpios, sizeof(*fwd->descs),
> + GFP_KERNEL);
One line.
...
> +static int gpiochip_fwd_register(struct gpiochip_fwd *fwd)
> +{
> + struct gpio_chip *chip = &fwd->chip;
> + struct device *dev = fwd->dev;
> + int error;
>
> if (chip->can_sleep)
> mutex_init(&fwd->mlock);
> else
> spin_lock_init(&fwd->slock);
>
> + error = devm_gpiochip_add_data(dev, chip, fwd);
> +
> + return error;
return devm_...
> +}
...
Overall it looks and feels like this can be split to more simpler logically
isolated changes. At least I see that folding function parameters can be a
separate patch.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-03-17 17:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 15:37 [PATCH RFC v2 0/6] Add pinctrl support for the AAEON UP board FPGA Thomas Richard
2025-03-17 15:37 ` [PATCH RFC v2 1/6] gpiolib: add gpiochip_add_pin_range_sparse() function Thomas Richard
2025-03-17 16:59 ` Andy Shevchenko
2025-04-09 13:49 ` Thomas Richard
2025-03-18 6:00 ` kernel test robot
2025-03-17 15:38 ` [PATCH RFC v2 2/6] gpio: aggregator: refactor the forwarder part Thomas Richard
2025-03-17 17:04 ` Andy Shevchenko [this message]
2025-03-17 15:38 ` [PATCH RFC v2 3/6] gpio: aggregator: export symbols of the gpio-fwd library Thomas Richard
2025-03-17 17:10 ` Andy Shevchenko
2025-03-17 15:38 ` [PATCH RFC v2 4/6] gpio: aggregator: handle runtime registration of gpio_desc in gpiochip_fwd Thomas Richard
2025-03-17 17:13 ` Andy Shevchenko
2025-04-09 14:50 ` Thomas Richard
2025-03-17 15:38 ` [PATCH RFC v2 5/6] gpio: aggregator: add possibility to attach data to the forwarder Thomas Richard
2025-03-18 13:18 ` Bartosz Golaszewski
2025-03-17 15:38 ` [PATCH RFC v2 6/6] pinctrl: Add pin controller driver for AAEON UP boards Thomas Richard
2025-03-17 18:42 ` Andy Shevchenko
2025-04-09 14:02 ` Thomas Richard
2025-04-15 8:39 ` Thomas Richard
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=Z9hWKxbcHlhyiCmR@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=DanieleCleri@aaeon.eu \
--cc=GaryWang@aaeon.com.tw \
--cc=brgl@bgdev.pl \
--cc=geert+renesas@glider.be \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=thomas.richard@bootlin.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.