[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <527c52aa-e9c6-41d5-a60d-60d79ab94439@kadam.mountain>
Date: Tue, 5 Sep 2023 11:27:50 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
Mark Brown <broonie@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, linux-spi@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [RFT PATCH v2] spi: bcm2835: reduce the abuse of the GPIO API
On Fri, Sep 01, 2023 at 02:15:39PM +0200, Linus Walleij wrote:
> On Fri, Sep 1, 2023 at 1:15 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> >
> > Currently the bcm2835 SPI driver uses functions that are available
> > exclusively to GPIO providers as a way to handle a platform quirk. Let's
> > use a slightly better alternative that avoids poking around in GPIOLIB's
> > internals and use GPIO lookup tables.
> >
> > Link: https://www.spinics.net/lists/linux-gpio/msg36218.html
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> > +#include <linux/cleanup.h>
> (...)
> > - struct gpio_chip *chip;
> > + struct gpiod_lookup_table *lookup __free(kfree) = NULL;
>
> Whoa!
> This is really neat.
Yeah. I like this stuff. It should fix a lot of issues. In some ways
I prefer this kind of clean up to devm_ managed resources.
> As noted, it will confuse static checkers at no end, but they just have
> to adopt. (CC to Dan C if he now runs into this.)
I think I updated Smatch to parse this correctly. I've tested on this
patch and it seems to work okay. There probably will be some fall out
in weird corners of Smatch. Let me know if you see any problems.
regards,
dan carpenter
Powered by blists - more mailing lists