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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Sep 2013 21:08:57 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Mathias Nyman <mathias.nyman@...ux.intel.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH 1/2] gpio / ACPI: register to ACPI events automatically

On Fri, Sep 13, 2013 at 5:14 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:

> Instead of asking each driver to register to the ACPI events we can just
> call acpi_gpiochip_register_interrupts() for each chip that has ACPI
> handle. It checks chip->to_irq and if it is set to NULL (a GPIO driver that
> doesn't do interrupts) the function does nothing.
>
> Also make the event interface to be private to gpiolib-acpi and remove call
> to the API from the one existing user (pinctrl-baytrail.c).
>
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

The concept looks sane...

> +void acpi_gpiochip_add(struct gpio_chip *chip)
> +{
> +       acpi_gpiochip_request_interrupts(chip);
> +}
> +EXPORT_SYMBOL_GPL(acpi_gpiochip_add);
> +
> +void acpi_gpiochip_remove(struct gpio_chip *chip)
> +{
> +       acpi_gpiochip_free_interrupts(chip);
> +}
> +EXPORT_SYMBOL_GPL(acpi_gpiochip_remove);

If you're only going to call this from within gpiolib, why are
you EXPORTing the APIs?

I think we should maybe create drivers/gpio/gpiolib.h
for such subsystem-local headers.

> @@ -1221,6 +1222,7 @@ int gpiochip_add(struct gpio_chip *chip)
>  #endif
>
>         of_gpiochip_add(chip);
> +       acpi_gpiochip_add(chip);
>
>         if (status)
>                 goto fail;
> @@ -1262,6 +1264,7 @@ int gpiochip_remove(struct gpio_chip *chip)
>
>         gpiochip_remove_pin_ranges(chip);
>         of_gpiochip_remove(chip);
> +       acpi_gpiochip_remove(chip);

What happens on a platform that is not using CONFIG_GPIO_ACPI
when they try to compile this?

You forgot to add static inline stubs for the non-ACPI case.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ