Move the last bits of code dealing with module parameters to the init
function. Add a new variable to platform data, which indicates to the
probe function if it should name the GPIO lines. If we ever want to
make the line naming more fine-grained (e.g. per chip switch) it will
be easier this way.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
int base;
int ngpio;
int index;
+ bool named_lines;
};
static int gpio_mockup_ranges[GPIO_MOCKUP_MAX_RANGES];
if (!chip->lines)
return -ENOMEM;
- if (gpio_mockup_named_lines) {
+ if (pdata->named_lines) {
rv = gpio_mockup_name_lines(dev, chip);
if (rv)
return rv;
pdata.ngpio = pdata.base < 0
? gpio_mockup_ranges[i * 2 + 1]
: gpio_mockup_ranges[i * 2 + 1] - pdata.base;
+ pdata.named_lines = gpio_mockup_named_lines;
pdev = platform_device_register_resndata(NULL,
GPIO_MOCKUP_NAME,