lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 7/9] gpio: mockup: pass the chip label as device property
    On Mon, Sep 28, 2020 at 12:41:53PM +0200, Bartosz Golaszewski wrote:
    > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
    >
    > While we do check the "chip-name" property in probe(), we never actually
    > use it. Let's pass the chip label to the driver using device properties
    > as we'll want to allow users to define their own once dynamically
    > created chips are supported.
    >
    > The property is renamed to "chip-label" to not cause any confusion with
    > the actual chip name which is of the form: "gpiochipX".
    >
    > If the "chip-label" property is missing, let's do what most devices in
    > drivers/gpio/ do and use dev_name().

    ...

    > + snprintf(chip_label, sizeof(chip_label),
    > + "gpio-mockup-%c", i + 'A');
    > + properties[prop++] = PROPERTY_ENTRY_STRING("chip-label",
    > + chip_label);

    You added new property, now count is up to 4. But at the same time

    #define GPIO_MOCKUP_MAX_PROP 4

    how do you avoid overflow?

    --
    With Best Regards,
    Andy Shevchenko


    \
     
     \ /
      Last update: 2020-09-28 15:00    [W:4.054 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site