Thread (22 messages) 22 messages, 5 authors, 2020-09-28

Re: [PATCH 8/9] gpio: mockup: use the generic 'gpio-line-names' property

From: Bartosz Golaszewski <hidden>
Date: 2020-09-25 11:40:24
Also in: linux-gpio, lkml

On Fri, Sep 25, 2020 at 11:03 AM Andy Shevchenko
[off-list ref] wrote:
On Thu, Sep 24, 2020 at 01:38:41PM +0200, Bartosz Golaszewski wrote:
quoted
From: Bartosz Golaszewski <redacted>

GPIO line names are currently created by the driver from the chip label.
We'll want to support custom formats for line names (for instance: to
name all lines the same) for user-space tests so create them in the
module init function and pass them to the driver using the standard
'gpio-line-names' property.
...
quoted
+             if (gpio_mockup_named_lines) {
+                     line_names = gpio_mockup_make_line_names(chip_label,
+                                                              ngpio);
+                     if (!line_names) {
+                             platform_driver_unregister(&gpio_mockup_driver);
+                             gpio_mockup_unregister_pdevs();
+                             return -ENOMEM;
+                     }
quoted
+                     properties[prop++] = PROPERTY_ENTRY_STRING_ARRAY_LEN(
+                                             "gpio-line-names",
+                                             line_names, ngpio);
Forgot to update GPIO_MOCKUP_MAX_PROP?
No, there are still three properties: chip-label, nr-gpios and
gpio-line-names. Same answer to patch 8/9.
quoted
+             }
...
quoted
+             kfree_strarray(line_names, line_names ? ngpio : 0);
Perhaps you may check for NULL pointer in the kfree_strarray() and drop ternary
here?
I did in the previous series and you told me to not to. :)

Bartosz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help