All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: tegra: Use correct offset for pin group
@ 2021-10-25 11:09 Prathamesh Shete
  2021-10-25 23:28 ` Linus Walleij
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Prathamesh Shete @ 2021-10-25 11:09 UTC (permalink / raw)
  To: linus.walleij, thierry.reding, jonathanh, linux-gpio,
	linux-tegra, linux-kernel
  Cc: smangipudi, pshete, kkartik

Function tegra_pinctrl_gpio_request_enable() and
tegra_pinctrl_gpio_disable_free() uses pin offset instead
of group offset, causing the driver to use wrong offset
to enable gpio.

Add a helper function tegra_pinctrl_get_group() to parse the
pin group and determine correct offset.

Signed-off-by: Kartik K <kkartik@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
---
 drivers/pinctrl/tegra/pinctrl-tegra.c | 33 +++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c
index 195cfe557511..0471d9c7f0ba 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra.c
@@ -275,6 +275,29 @@ static int tegra_pinctrl_set_mux(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
+static struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev *pctldev,
+					unsigned int offset)
+{
+	struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
+	struct tegra_pingroup *g;
+	unsigned int group, num_pins, j;
+	const unsigned int *pins;
+	int ret;
+
+	for (group = 0; group < pmx->soc->ngroups; ++group) {
+		ret = tegra_pinctrl_get_group_pins(pctldev, group, &pins, &num_pins);
+		if (ret < 0)
+			continue;
+		for (j = 0; j < num_pins; j++) {
+			if (offset == pins[j])
+				return &pmx->soc->groups[group];
+		}
+	}
+
+	dev_err(pctldev->dev, "Pingroup not found for pin %u\n", offset);
+	return NULL;
+}
+
 static int tegra_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
 					     struct pinctrl_gpio_range *range,
 					     unsigned int offset)
@@ -286,7 +309,10 @@ static int tegra_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
 	if (!pmx->soc->sfsel_in_mux)
 		return 0;
 
-	group = &pmx->soc->groups[offset];
+	group = tegra_pinctrl_get_group(pctldev, offset);
+
+	if (!group)
+		return -EINVAL;
 
 	if (group->mux_reg < 0 || group->sfsel_bit < 0)
 		return -EINVAL;
@@ -309,7 +335,10 @@ static void tegra_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
 	if (!pmx->soc->sfsel_in_mux)
 		return;
 
-	group = &pmx->soc->groups[offset];
+	group = tegra_pinctrl_get_group(pctldev, offset);
+
+	if (!group)
+		return -EINVAL;
 
 	if (group->mux_reg < 0 || group->sfsel_bit < 0)
 		return;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: tegra: Use correct offset for pin group
  2021-10-25 11:09 [PATCH] pinctrl: tegra: Use correct offset for pin group Prathamesh Shete
@ 2021-10-25 23:28 ` Linus Walleij
  2021-10-26 12:37   ` kernel test robot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-10-25 23:28 UTC (permalink / raw)
  To: Prathamesh Shete
  Cc: thierry.reding, Jon Hunter, open list:GPIO SUBSYSTEM,
	linux-tegra, linux-kernel, Suresh Mangipudi, kkartik

On Mon, Oct 25, 2021 at 1:10 PM Prathamesh Shete <pshete@nvidia.com> wrote:

> Function tegra_pinctrl_gpio_request_enable() and
> tegra_pinctrl_gpio_disable_free() uses pin offset instead
> of group offset, causing the driver to use wrong offset
> to enable gpio.
>
> Add a helper function tegra_pinctrl_get_group() to parse the
> pin group and determine correct offset.
>
> Signed-off-by: Kartik K <kkartik@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: tegra: Use correct offset for pin group
  2021-10-25 11:09 [PATCH] pinctrl: tegra: Use correct offset for pin group Prathamesh Shete
@ 2021-10-26 12:37   ` kernel test robot
  2021-10-26 12:37   ` kernel test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-10-26 12:37 UTC (permalink / raw)
  To: Prathamesh Shete; +Cc: llvm, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4992 bytes --]

Hi Prathamesh,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v5.15-rc7 next-20211026]
[cannot apply to linusw-pinctrl/devel]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm64-randconfig-r035-20211025 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a461fa64bb37cffd73f683c74f6b0780379fc2ca)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
        git checkout 2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/pinctrl/tegra/pinctrl-tegra.c:293:12: error: returning 'const struct tegra_pingroup *' from a function with result type 'struct tegra_pingroup *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                                   return &pmx->soc->groups[group];
                                          ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/tegra/pinctrl-tegra.c:282:25: warning: unused variable 'g' [-Wunused-variable]
           struct tegra_pingroup *g;
                                  ^
>> drivers/pinctrl/tegra/pinctrl-tegra.c:341:3: error: void function 'tegra_pinctrl_gpio_disable_free' should not return a value [-Wreturn-type]
                   return -EINVAL;
                   ^      ~~~~~~~
   1 warning and 2 errors generated.


vim +293 drivers/pinctrl/tegra/pinctrl-tegra.c

   277	
   278	static struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev *pctldev,
   279						unsigned int offset)
   280	{
   281		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   282		struct tegra_pingroup *g;
   283		unsigned int group, num_pins, j;
   284		const unsigned int *pins;
   285		int ret;
   286	
   287		for (group = 0; group < pmx->soc->ngroups; ++group) {
   288			ret = tegra_pinctrl_get_group_pins(pctldev, group, &pins, &num_pins);
   289			if (ret < 0)
   290				continue;
   291			for (j = 0; j < num_pins; j++) {
   292				if (offset == pins[j])
 > 293					return &pmx->soc->groups[group];
   294			}
   295		}
   296	
   297		dev_err(pctldev->dev, "Pingroup not found for pin %u\n", offset);
   298		return NULL;
   299	}
   300	
   301	static int tegra_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
   302						     struct pinctrl_gpio_range *range,
   303						     unsigned int offset)
   304	{
   305		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   306		const struct tegra_pingroup *group;
   307		u32 value;
   308	
   309		if (!pmx->soc->sfsel_in_mux)
   310			return 0;
   311	
   312		group = tegra_pinctrl_get_group(pctldev, offset);
   313	
   314		if (!group)
   315			return -EINVAL;
   316	
   317		if (group->mux_reg < 0 || group->sfsel_bit < 0)
   318			return -EINVAL;
   319	
   320		value = pmx_readl(pmx, group->mux_bank, group->mux_reg);
   321		value &= ~BIT(group->sfsel_bit);
   322		pmx_writel(pmx, value, group->mux_bank, group->mux_reg);
   323	
   324		return 0;
   325	}
   326	
   327	static void tegra_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
   328						    struct pinctrl_gpio_range *range,
   329						    unsigned int offset)
   330	{
   331		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   332		const struct tegra_pingroup *group;
   333		u32 value;
   334	
   335		if (!pmx->soc->sfsel_in_mux)
   336			return;
   337	
   338		group = tegra_pinctrl_get_group(pctldev, offset);
   339	
   340		if (!group)
 > 341			return -EINVAL;
   342	
   343		if (group->mux_reg < 0 || group->sfsel_bit < 0)
   344			return;
   345	
   346		value = pmx_readl(pmx, group->mux_bank, group->mux_reg);
   347		value |= BIT(group->sfsel_bit);
   348		pmx_writel(pmx, value, group->mux_bank, group->mux_reg);
   349	}
   350	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38919 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: tegra: Use correct offset for pin group
@ 2021-10-26 12:37   ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-10-26 12:37 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5118 bytes --]

Hi Prathamesh,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v5.15-rc7 next-20211026]
[cannot apply to linusw-pinctrl/devel]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm64-randconfig-r035-20211025 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a461fa64bb37cffd73f683c74f6b0780379fc2ca)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
        git checkout 2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/pinctrl/tegra/pinctrl-tegra.c:293:12: error: returning 'const struct tegra_pingroup *' from a function with result type 'struct tegra_pingroup *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                                   return &pmx->soc->groups[group];
                                          ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/tegra/pinctrl-tegra.c:282:25: warning: unused variable 'g' [-Wunused-variable]
           struct tegra_pingroup *g;
                                  ^
>> drivers/pinctrl/tegra/pinctrl-tegra.c:341:3: error: void function 'tegra_pinctrl_gpio_disable_free' should not return a value [-Wreturn-type]
                   return -EINVAL;
                   ^      ~~~~~~~
   1 warning and 2 errors generated.


vim +293 drivers/pinctrl/tegra/pinctrl-tegra.c

   277	
   278	static struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev *pctldev,
   279						unsigned int offset)
   280	{
   281		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   282		struct tegra_pingroup *g;
   283		unsigned int group, num_pins, j;
   284		const unsigned int *pins;
   285		int ret;
   286	
   287		for (group = 0; group < pmx->soc->ngroups; ++group) {
   288			ret = tegra_pinctrl_get_group_pins(pctldev, group, &pins, &num_pins);
   289			if (ret < 0)
   290				continue;
   291			for (j = 0; j < num_pins; j++) {
   292				if (offset == pins[j])
 > 293					return &pmx->soc->groups[group];
   294			}
   295		}
   296	
   297		dev_err(pctldev->dev, "Pingroup not found for pin %u\n", offset);
   298		return NULL;
   299	}
   300	
   301	static int tegra_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
   302						     struct pinctrl_gpio_range *range,
   303						     unsigned int offset)
   304	{
   305		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   306		const struct tegra_pingroup *group;
   307		u32 value;
   308	
   309		if (!pmx->soc->sfsel_in_mux)
   310			return 0;
   311	
   312		group = tegra_pinctrl_get_group(pctldev, offset);
   313	
   314		if (!group)
   315			return -EINVAL;
   316	
   317		if (group->mux_reg < 0 || group->sfsel_bit < 0)
   318			return -EINVAL;
   319	
   320		value = pmx_readl(pmx, group->mux_bank, group->mux_reg);
   321		value &= ~BIT(group->sfsel_bit);
   322		pmx_writel(pmx, value, group->mux_bank, group->mux_reg);
   323	
   324		return 0;
   325	}
   326	
   327	static void tegra_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
   328						    struct pinctrl_gpio_range *range,
   329						    unsigned int offset)
   330	{
   331		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   332		const struct tegra_pingroup *group;
   333		u32 value;
   334	
   335		if (!pmx->soc->sfsel_in_mux)
   336			return;
   337	
   338		group = tegra_pinctrl_get_group(pctldev, offset);
   339	
   340		if (!group)
 > 341			return -EINVAL;
   342	
   343		if (group->mux_reg < 0 || group->sfsel_bit < 0)
   344			return;
   345	
   346		value = pmx_readl(pmx, group->mux_bank, group->mux_reg);
   347		value |= BIT(group->sfsel_bit);
   348		pmx_writel(pmx, value, group->mux_bank, group->mux_reg);
   349	}
   350	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38919 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: tegra: Use correct offset for pin group
  2021-10-25 11:09 [PATCH] pinctrl: tegra: Use correct offset for pin group Prathamesh Shete
  2021-10-25 23:28 ` Linus Walleij
  2021-10-26 12:37   ` kernel test robot
@ 2021-10-26 12:54 ` kernel test robot
  2021-10-26 17:58 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-10-26 12:54 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]

Hi Prathamesh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on v5.15-rc7 next-20211026]
[cannot apply to linusw-pinctrl/devel]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
        git checkout 2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/pinctrl/tegra/pinctrl-tegra.c: In function 'tegra_pinctrl_get_group':
>> drivers/pinctrl/tegra/pinctrl-tegra.c:293:40: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     293 |                                 return &pmx->soc->groups[group];
         |                                        ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/tegra/pinctrl-tegra.c:282:32: warning: unused variable 'g' [-Wunused-variable]
     282 |         struct tegra_pingroup *g;
         |                                ^
   drivers/pinctrl/tegra/pinctrl-tegra.c: In function 'tegra_pinctrl_gpio_disable_free':
   drivers/pinctrl/tegra/pinctrl-tegra.c:341:24: error: 'return' with a value, in function returning void [-Werror=return-type]
     341 |                 return -EINVAL;
         |                        ^
   drivers/pinctrl/tegra/pinctrl-tegra.c:327:13: note: declared here
     327 | static void tegra_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/const +293 drivers/pinctrl/tegra/pinctrl-tegra.c

   277	
   278	static struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev *pctldev,
   279						unsigned int offset)
   280	{
   281		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
   282		struct tegra_pingroup *g;
   283		unsigned int group, num_pins, j;
   284		const unsigned int *pins;
   285		int ret;
   286	
   287		for (group = 0; group < pmx->soc->ngroups; ++group) {
   288			ret = tegra_pinctrl_get_group_pins(pctldev, group, &pins, &num_pins);
   289			if (ret < 0)
   290				continue;
   291			for (j = 0; j < num_pins; j++) {
   292				if (offset == pins[j])
 > 293					return &pmx->soc->groups[group];
   294			}
   295		}
   296	
   297		dev_err(pctldev->dev, "Pingroup not found for pin %u\n", offset);
   298		return NULL;
   299	}
   300	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 55336 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: tegra: Use correct offset for pin group
  2021-10-25 11:09 [PATCH] pinctrl: tegra: Use correct offset for pin group Prathamesh Shete
                   ` (2 preceding siblings ...)
  2021-10-26 12:54 ` kernel test robot
@ 2021-10-26 17:58 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-10-26 17:58 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3645 bytes --]

Hi Prathamesh,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v5.15-rc7 next-20211026]
[cannot apply to linusw-pinctrl/devel]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Prathamesh-Shete/pinctrl-tegra-Use-correct-offset-for-pin-group/20211025-191234
        git checkout 2fc9d61e0fb127a2e51e51cf0c2c6f2a9528cb37
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/pinctrl/tegra/pinctrl-tegra.c: In function 'tegra_pinctrl_get_group':
>> drivers/pinctrl/tegra/pinctrl-tegra.c:293:40: error: return discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     293 |                                 return &pmx->soc->groups[group];
         |                                        ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra.c:282:32: error: unused variable 'g' [-Werror=unused-variable]
     282 |         struct tegra_pingroup *g;
         |                                ^
   drivers/pinctrl/tegra/pinctrl-tegra.c: In function 'tegra_pinctrl_gpio_disable_free':
   drivers/pinctrl/tegra/pinctrl-tegra.c:341:24: error: 'return' with a value, in function returning void [-Werror=return-type]
     341 |                 return -EINVAL;
         |                        ^
   drivers/pinctrl/tegra/pinctrl-tegra.c:327:13: note: declared here
     327 | static void tegra_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +/const +293 drivers/pinctrl/tegra/pinctrl-tegra.c

   277	
   278	static struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev *pctldev,
   279						unsigned int offset)
   280	{
   281		struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
 > 282		struct tegra_pingroup *g;
   283		unsigned int group, num_pins, j;
   284		const unsigned int *pins;
   285		int ret;
   286	
   287		for (group = 0; group < pmx->soc->ngroups; ++group) {
   288			ret = tegra_pinctrl_get_group_pins(pctldev, group, &pins, &num_pins);
   289			if (ret < 0)
   290				continue;
   291			for (j = 0; j < num_pins; j++) {
   292				if (offset == pins[j])
 > 293					return &pmx->soc->groups[group];
   294			}
   295		}
   296	
   297		dev_err(pctldev->dev, "Pingroup not found for pin %u\n", offset);
   298		return NULL;
   299	}
   300	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 79216 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-26 17:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 11:09 [PATCH] pinctrl: tegra: Use correct offset for pin group Prathamesh Shete
2021-10-25 23:28 ` Linus Walleij
2021-10-26 12:37 ` kernel test robot
2021-10-26 12:37   ` kernel test robot
2021-10-26 12:54 ` kernel test robot
2021-10-26 17:58 ` kernel test robot

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.