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 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