public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: ALOK TIWARI <alok.a.tiwari@oracle.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Takahiro AKASHI <akashi.tkhro@gmail.com>
Subject: Re: [RFC 3/7] pinctrl: introduce pinctrl_gpio_get_config()
Date: Wed, 7 May 2025 14:32:25 +0300	[thread overview]
Message-ID: <aBtEyciwVip9FaKP@stanley.mountain> (raw)
In-Reply-To: <f59c3493-4630-4cf1-8d25-d4e9fbf23498@oracle.com>

On Mon, May 05, 2025 at 10:00:35PM +0530, ALOK TIWARI wrote:
> > +int pinctrl_gpio_get_config(struct gpio_chip *gc, unsigned int offset, unsigned long *config)
> > +{
> > +	struct pinctrl_gpio_range *range;
> > +	const struct pinconf_ops *ops;
> > +	struct pinctrl_dev *pctldev;
> > +	int ret, pin;
> > +
> > +	ret = pinctrl_get_device_gpio_range(gc, offset, &pctldev, &range);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ops = pctldev->desc->confops;
> > +	if (!ops || !ops->pin_config_get)
> > +		return -EINVAL;
> > +
> > +	mutex_lock(&pctldev->mutex);
> > +	pin = gpio_to_pin(range, gc, offset);
> > +	ret = ops->pin_config_get(pctldev, pin, config);
> 
> can we add reason here, as now we are not calling pin_config_get_for_pin()
> 
> https://lore.kernel.org/all/20231002021602.260100-3-takahiro.akashi@linaro.org/
> 

I don't even know why I changed that.  Using pin_config_get_for_pin()
works and it's cleaner.

regards,
dan carpenter


  reply	other threads:[~2025-05-07 11:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05 11:36 [RFC 0/7] pinctrl-scmi: Add GPIO support Dan Carpenter
2025-05-05 11:37 ` [RFC 3/7] pinctrl: introduce pinctrl_gpio_get_config() Dan Carpenter
2025-05-05 16:30   ` ALOK TIWARI
2025-05-07 11:32     ` Dan Carpenter [this message]
2025-05-05 11:38 ` [RFC 4/7] pinctrl-scmi: add PIN_CONFIG_INPUT_VALUE Dan Carpenter
2025-05-05 11:39 ` [RFC 5/7] pinctrl: Delete PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS support Dan Carpenter
2025-05-05 11:39 ` [RFC 6/7] pinctrl-scmi: Add GPIO support Dan Carpenter
2025-05-05 11:39 ` [RFC 7/7] pinctrl-scmi: remove unused struct member Dan Carpenter
2025-05-07  8:54 ` [RFC 0/7] pinctrl-scmi: Add GPIO support Khaled Ali Ahmed

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=aBtEyciwVip9FaKP@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=akashi.tkhro@gmail.com \
    --cc=alok.a.tiwari@oracle.com \
    --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