Re: [PATCH] media: em28xx: Drop abuse of gpiolib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On Wed, Jan 11, 2023 at 02:58:01PM +0100, Linus Walleij wrote:
> The driver is issueing calls to the legacy gpio API from
> <linux/gpio.h> to pull a LNA gpio line low or high.
> 
> The code as it stands can not work and does not make sense
> since the GPIO number assigned to dvb->lna_gpio is only
> in scope in this file and never assigned any valid GPIO
> number, the driver has no way of asking for a proper GPIO
> and will likely ask for GPIO 0, which will likely be wrong.
> 
> In one execution path dvb->lna_gpio is assigned some constants
> to the local GPIO block which is not using gpiolib, adding
> to the confusion.

The dvb->lna_gpio gets reassigned in the call to

	dvb->fe[0] = dvb_attach(cxd2820r_attach, ...);

which calls cxd2820r_attach() which ends up calling cxd2820r_probe()
which creates a gpiochip and passes back the first gpio number. It all
seems very fragile and will break if dependencies are not linked "just
right" and I have no idea if this all still actually works...

Thanks.

-- 
Dmitry



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux