Re: [PATCH 1/5] gpio: of: Support SPI nonstandard GPIO properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 3, 2018 at 4:23 PM, Rob Herring <robh@xxxxxxxxxx> wrote:
> On Mon, Jan 1, 2018 at 7:37 AM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:

>> +/*
>> + * The SPI GPIO bindings happened before we managed to establish that GPIO
>> + * properties should be named "foo-gpios" so we have this special kludge for
>> + * them.
>> + */
>> +#ifdef CONFIG_SPI_MASTER
>> +static struct gpio_desc *of_find_spi_gpio(struct device *dev, const char *con_id,
>> +                                         enum of_gpio_flags *of_flags)
>> +{
>> +       char prop_name[32]; /* 32 is max size of property name */
>> +       struct device_node *np = dev->of_node;
>> +       struct gpio_desc *desc;
>
> Instead of the ifdef:
>
> if (!IS_ENABLED(CONFIG_SPI_MASTER))
>   return ERR_PTR(-ENOENT);
>
> Or merge the condition with the if below.

I was consciously exploting the fact the CONFIG_SPI_MASTER is bool,
but I guess that can be fragile if someone decides to modularize it so, OK.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux