lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 1/2] of: property: Add fw_devlink support for "gpio" and "gpios" binding
On Wed, Jan 20, 2021 at 9:05 AM Saravana Kannan <saravanak@google.com> wrote:

> To provide backward compatibility for boards that use deprecated DT
> bindings, we need to add fw_devlink support for "gpio" and "gpios".

You do some more stuff in the patch so describe that too.
Especially the check for hogs and #gpio-cells.
Describe why you do that. Maybe even with a comment in
the code because I don't think everyone will understand.

> + if (strcmp(prop_name, "gpio") && strcmp(prop_name, "gpios"))
> + return NULL;

This part is easy to understand.

> + if (of_find_property(np, "gpio-hog", NULL))
> + return NULL;
> +
> + if (of_parse_phandle_with_args(np, prop_name, "#gpio-cells", index,
> + &sup_args))
> + return NULL;

This part is hard to understand. Insert comments and tell the reader
of the code what is going on and why.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2021-01-21 14:14    [W:0.061 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site