[PATCH] pinctrl: rockchip: find gpiochip by name from gpio module

jay.xu at rock-chips.com jay.xu at rock-chips.com
Mon Sep 19 18:23:59 PDT 2022


Hi Andy and Walleij

--------------
jay.xu at rock-chips.com
>On Fri, Sep 16, 2022 at 04:43:43PM +0800, Jianqun Xu wrote:
>> Currently the pinctrl device acts as parent for the gpio devices for
>> rockchip platform, the pinctrl driver probes first and then populate the
>> gpio platform lastly.
>>
>> This patch makes the pinctrl to populate gpio platform firstly and then
>> do probe after gpio probed successfully. And get gpiochips througth a
>> find function by the gpio label.
>
>> +static int gpiochip_match_name(struct gpio_chip *gc, void *data)
>> +{
>> +	const char *name = data;
>> +
>> +	return !strcmp(gc->label, name);
>> +}
>
>> +	gc = gpiochip_find((void *)ctrl->pin_banks[i].name, gpiochip_match_name);
>> +	if (!gc) {
>> +	dev_err(dev, "fail to find gpiochip\n");
>> +	return ret;
>> +	}
>
>NIH find_chip_by_name()
> 
I send a patch "[PATCH RESEND] gpiolib: make gpiochip_find_by_name to be common function"
please help to review before this patch, thanks
>
>--
>With Best Regards,
>Andy Shevchenko
>
>
>
>--
>With Best Regards,
>Andy Shevchenko
>
>


More information about the Linux-rockchip mailing list