public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hawa, Hanna" <hhhawa@amazon.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Wolfram Sang <wsa@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: <jarkko.nikula@linux.intel.com>,
	<mika.westerberg@linux.intel.com>, <jsd@semihalf.com>,
	<linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<dwmw@amazon.co.uk>, <benh@amazon.com>, <ronenk@amazon.com>,
	<talel@amazon.com>, <jonnyc@amazon.com>, <hanochu@amazon.com>,
	<farbere@amazon.com>, <itamark@amazon.com>
Subject: Re: [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl
Date: Fri, 16 Dec 2022 15:50:19 +0200	[thread overview]
Message-ID: <1408bbef-10e3-f76b-b66d-b95e84748e18@amazon.com> (raw)
In-Reply-To: <Y5r2pZhe17dVBMme@smile.fi.intel.com>



On 12/15/2022 12:27 PM, Andy Shevchenko wrote:
> OK, but why that function doesn't use the dev->pins->p if it's defined?
> (As a fallback when rinfo->pinctrl is NULL. >

The solution will look like the below diff (get_device_pinctrl() is new 
function that i've added that return the dev->pins->p)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 7539b0740351..469344d4ee43 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -34,6 +34,7 @@
  #include <linux/of.h>
  #include <linux/of_irq.h>
  #include <linux/pinctrl/consumer.h>
+#include <linux/pinctrl/devinfo.h>
  #include <linux/pm_domain.h>
  #include <linux/pm_runtime.h>
  #include <linux/pm_wakeirq.h>
@@ -282,7 +283,11 @@ static void i2c_gpio_init_pinctrl_recovery(struct 
i2c_adapter *adap)
  {
         struct i2c_bus_recovery_info *bri = adap->bus_recovery_info;
         struct device *dev = &adap->dev;
-       struct pinctrl *p = bri->pinctrl;
+       struct pinctrl *p;
+
+       if (!bri->pinctrl)
+               bri->pinctrl = get_device_pinctrl(dev->parent);
+       p = bri->pinctrl;

> Wolfram?
> 
> Hanna, it seems you missed I²C maintainer to Cc...

I based my CC/TO on get_maintainer.pl script. Will make sure that 
Wolfram on CC next time.

  parent reply	other threads:[~2022-12-16 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 14:27 [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl Hanna Hawa
2022-12-14 16:09 ` Andy Shevchenko
2022-12-15  8:15   ` Hawa, Hanna
2022-12-15 10:27     ` Andy Shevchenko
2022-12-15 14:06       ` Linus Walleij
2022-12-15 14:25         ` Hawa, Hanna
2022-12-15 15:22         ` Andy Shevchenko
2022-12-16 13:50       ` Hawa, Hanna [this message]
2022-12-16 14:46         ` Andy Shevchenko
2022-12-19 19:35           ` Hawa, Hanna
2022-12-20 10:54             ` Andy Shevchenko
2022-12-14 19:14 ` kernel test robot
2022-12-15  0:17 ` kernel test robot

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=1408bbef-10e3-f76b-b66d-b95e84748e18@amazon.com \
    --to=hhhawa@amazon.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=benh@amazon.com \
    --cc=dwmw@amazon.co.uk \
    --cc=farbere@amazon.com \
    --cc=hanochu@amazon.com \
    --cc=itamark@amazon.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jonnyc@amazon.com \
    --cc=jsd@semihalf.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=ronenk@amazon.com \
    --cc=talel@amazon.com \
    --cc=wsa@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