All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] media: em28xx: Drop abuse of gpiolib
Date: Wed, 11 Jan 2023 10:49:01 -0800	[thread overview]
Message-ID: <Y78EnUP1zCLVAR5k@google.com> (raw)
In-Reply-To: <20230111135801.135824-1-linus.walleij@linaro.org>

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

      reply	other threads:[~2023-01-11 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 13:58 [PATCH] media: em28xx: Drop abuse of gpiolib Linus Walleij
2023-01-11 18:49 ` Dmitry Torokhov [this message]

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=Y78EnUP1zCLVAR5k@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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 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.