tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-spi head: 22b4cce644e2a37043b522197f7941eff3c6561c commit: d1bec4f1f9f8106c2f445c1ea6c7c2a1ba104635 [1/6] gpio: of: Handle the Freescale SPI CS config: openrisc-or1ksim_defconfig (attached as .config) compiler: or1k-linux-gcc (GCC) 7.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout d1bec4f1f9f8106c2f445c1ea6c7c2a1ba104635 # save the attached .config to linux build tree GCC_VERSION=7.3.0 make.cross ARCH=openrisc If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): drivers/gpio/gpiolib-of.c: In function 'of_find_spi_cs_gpio': >> drivers/gpio/gpiolib-of.c:285:38: error: passing argument 4 of 'of_find_gpio' from incompatible pointer type [-Werror=incompatible-pointer-types] return of_find_gpio(dev, NULL, idx, flags); ^~~~~ In file included from drivers/gpio/gpiolib-of.c:23:0: drivers/gpio/gpiolib.h:96:19: note: expected 'long unsigned int *' but argument is of type 'enum gpio_lookup_flags *' struct gpio_desc *of_find_gpio(struct device *dev, ^~~~~~~~~~~~ drivers/gpio/gpiolib-of.c: In function 'of_find_gpio': >> drivers/gpio/gpiolib-of.c:361:48: error: passing argument 4 of 'of_find_spi_cs_gpio' from incompatible pointer type [-Werror=incompatible-pointer-types] desc = of_find_spi_cs_gpio(dev, con_id, idx, flags); ^~~~~ drivers/gpio/gpiolib-of.c:262:26: note: expected 'enum gpio_lookup_flags *' but argument is of type 'long unsigned int *' static struct gpio_desc *of_find_spi_cs_gpio(struct device *dev, ^~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +/of_find_gpio +285 drivers/gpio/gpiolib-of.c 256 257 /* 258 * The old Freescale bindings use simply "gpios" as name for the chip select 259 * lines rather than "cs-gpios" like all other SPI hardware. Account for this 260 * with a special quirk. 261 */ 262 static struct gpio_desc *of_find_spi_cs_gpio(struct device *dev, 263 const char *con_id, 264 unsigned int idx, 265 enum gpio_lookup_flags *flags) 266 { 267 struct device_node *np = dev->of_node; 268 269 if (!IS_ENABLED(CONFIG_SPI_MASTER)) 270 return ERR_PTR(-ENOENT); 271 272 /* Allow this specifically for Freescale devices */ 273 if (!of_device_is_compatible(np, "fsl,spi") && 274 !of_device_is_compatible(np, "aeroflexgaisler,spictrl")) 275 return ERR_PTR(-ENOENT); 276 /* Allow only if asking for "cs-gpios" */ 277 if (!con_id || strcmp(con_id, "cs")) 278 return ERR_PTR(-ENOENT); 279 280 /* 281 * While all other SPI controllers use "cs-gpios" the Freescale 282 * uses just "gpios" so translate to that when "cs-gpios" is 283 * requested. 284 */ > 285 return of_find_gpio(dev, NULL, idx, flags); 286 } 287 288 /* 289 * Some regulator bindings happened before we managed to establish that GPIO 290 * properties should be named "foo-gpios" so we have this special kludge for 291 * them. 292 */ 293 static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char *con_id, 294 enum of_gpio_flags *of_flags) 295 { 296 /* These are the connection IDs we accept as legacy GPIO phandles */ 297 const char *whitelist[] = { 298 "wlf,ldoena", /* Arizona */ 299 "wlf,ldo1ena", /* WM8994 */ 300 "wlf,ldo2ena", /* WM8994 */ 301 }; 302 struct device_node *np = dev->of_node; 303 struct gpio_desc *desc; 304 int i; 305 306 if (!IS_ENABLED(CONFIG_REGULATOR)) 307 return ERR_PTR(-ENOENT); 308 309 if (!con_id) 310 return ERR_PTR(-ENOENT); 311 312 i = match_string(whitelist, ARRAY_SIZE(whitelist), con_id); 313 if (i < 0) 314 return ERR_PTR(-ENOENT); 315 316 desc = of_get_named_gpiod_flags(np, con_id, 0, of_flags); 317 return desc; 318 } 319 320 struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, 321 unsigned int idx, unsigned long *flags) 322 { 323 char prop_name[32]; /* 32 is max size of property name */ 324 enum of_gpio_flags of_flags; 325 struct gpio_desc *desc; 326 unsigned int i; 327 328 /* Try GPIO property "foo-gpios" and "foo-gpio" */ 329 for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) { 330 if (con_id) 331 snprintf(prop_name, sizeof(prop_name), "%s-%s", con_id, 332 gpio_suffixes[i]); 333 else 334 snprintf(prop_name, sizeof(prop_name), "%s", 335 gpio_suffixes[i]); 336 337 desc = of_get_named_gpiod_flags(dev->of_node, prop_name, idx, 338 &of_flags); 339 /* 340 * -EPROBE_DEFER in our case means that we found a 341 * valid GPIO property, but no controller has been 342 * registered so far. 343 * 344 * This means we don't need to look any further for 345 * alternate name conventions, and we should really 346 * preserve the return code for our user to be able to 347 * retry probing later. 348 */ 349 if (IS_ERR(desc) && PTR_ERR(desc) == -EPROBE_DEFER) 350 return desc; 351 352 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) 353 break; 354 } 355 356 /* Special handling for SPI GPIOs if used */ 357 if (IS_ERR(desc)) 358 desc = of_find_spi_gpio(dev, con_id, &of_flags); 359 if (IS_ERR(desc)) { 360 /* This quirk looks up flags and all */ > 361 desc = of_find_spi_cs_gpio(dev, con_id, idx, flags); 362 if (!IS_ERR(desc)) 363 return desc; 364 } 365 366 /* Special handling for regulator GPIOs if used */ 367 if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) 368 desc = of_find_regulator_gpio(dev, con_id, &of_flags); 369 370 if (IS_ERR(desc)) 371 return desc; 372 373 if (of_flags & OF_GPIO_ACTIVE_LOW) 374 *flags |= GPIO_ACTIVE_LOW; 375 376 if (of_flags & OF_GPIO_SINGLE_ENDED) { 377 if (of_flags & OF_GPIO_OPEN_DRAIN) 378 *flags |= GPIO_OPEN_DRAIN; 379 else 380 *flags |= GPIO_OPEN_SOURCE; 381 } 382 383 if (of_flags & OF_GPIO_TRANSITORY) 384 *flags |= GPIO_TRANSITORY; 385 386 if (of_flags & OF_GPIO_PULL_UP) 387 *flags |= GPIO_PULL_UP; 388 if (of_flags & OF_GPIO_PULL_DOWN) 389 *flags |= GPIO_PULL_DOWN; 390 391 return desc; 392 } 393 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip