lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdYo9690n57FYAM1heSU+zGTKuze8B3d+Q4Py=HJr34-Eg@mail.gmail.com>
Date: Thu, 6 Feb 2025 19:40:36 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Laurentiu Palcu <laurentiu.palcu@....nxp.com>
Cc: Niklas Söderlund <niklas.soderlund@...natech.se>, 
	Mauro Carvalho Chehab <mchehab@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	Bartosz Golaszewski <brgl@...ev.pl>, linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-media@...r.kernel.org, linux-staging@...ts.linux.dev
Subject: Re: [RFC 10/12] staging: media: max96712: add gpiochip functionality

Hi Laurentiu,

thanks for your patch!

On Fri, Jan 31, 2025 at 5:35 PM Laurentiu Palcu
<laurentiu.palcu@....nxp.com> wrote:

> The deserializer has GPIOs that can be used for various purposes. Add
> support for gpiochip.
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@....nxp.com>

Since you are using CONFIG_GPIOLIB unconditionally you need
to add

select GPIOLIB

in the Kconfig for this driver, or the autobuilder will soon start to
spam you with compilation errors.

> +static int max96712_gpiochip_probe(struct max96712_priv *priv)
> +{
> +       struct device *dev = &priv->client->dev;
> +       struct gpio_chip *gc = &priv->gpio_chip;
> +       int i, ret = 0;
> +
> +       gc->label = dev_name(dev);
> +       gc->parent = dev;

I don't think you need to assign parent. (Default)

> +       gc->owner = THIS_MODULE;

Or this. (Default)

> +       gc->ngpio = MAX96712_NUM_GPIO;
> +       gc->base = -1;
> +       gc->can_sleep = true;
> +       gc->get_direction = max96712_gpio_get_direction;
> +       gc->direction_input = max96712_gpio_direction_in;
> +       gc->direction_output = max96712_gpio_direction_out;
> +       gc->request = gpiochip_generic_request;
> +       gc->set = max96712_gpiochip_set;
> +       gc->get = max96712_gpiochip_get;
> +       gc->of_gpio_n_cells = 2;

Isn't that the default? Do you need to assign this?

Other than that this looks good, so with the small fix above:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ