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]
Message-ID: <20140417110756.GB32603@ulmo>
Date:	Thu, 17 Apr 2014 13:08:07 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Chew Chiau Ee <chiau.ee.chew@...el.com>
Cc:	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Alan Cox <alan@...ux.intel.com>, linux-pwm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] pwm_lpss: Add support for PCI devices

On Thu, Apr 17, 2014 at 02:18:58AM +0800, Chew Chiau Ee wrote:
> From: Alan Cox <alan@...ux.intel.com>
> 
> Not all systems enumerate the PWM devices via ACPI. They can also be exposed
> via the PCI interface.
> 
> Signed-off-by: Alan Cox <alan@...ux.intel.com>
> Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@...el.com>
> ---
>  drivers/pwm/pwm-lpss.c |  159 ++++++++++++++++++++++++++++++++++++++---------
>  1 files changed, 128 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
> index 449e372..aa8af08 100644
> --- a/drivers/pwm/pwm-lpss.c
> +++ b/drivers/pwm/pwm-lpss.c
> @@ -6,6 +6,7 @@
>   * Author: Chew Kean Ho <kean.ho.chew@...el.com>
>   * Author: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@...el.com>
>   * Author: Chew Chiau Ee <chiau.ee.chew@...el.com>
> + * Author: Alan Cox <alan@...ux.intel.com>
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
> @@ -19,6 +20,9 @@
>  #include <linux/module.h>
>  #include <linux/pwm.h>
>  #include <linux/platform_device.h>
> +#include <linux/pci.h>
> +
> +static int pci_drv, plat_drv;	/* So we know which drivers registered */

I think that rather than having everything in a single file, perhaps a
better approach would be to keep pwm-lpss.c as a common module and then
have separate drivers for ACPI (pwm-lpss-acpi) and PCI (pwm-lpss-pci).
That way you don't have to keep track of which driver was successfully
registered.

Would that work?

> +static const struct pwm_lpss_boardinfo byt_info = {

What does byt_ stand for?

> -static int pwm_lpss_probe(struct platform_device *pdev)
> +static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev,
> +			struct resource *r, struct pwm_lpss_boardinfo *info)

Indentation is odd here. Please align arguments one subsequent lines
with those of the first.

> -static struct platform_driver pwm_lpss_driver = {
> +static int pwm_lpss_probe_pci(struct pci_dev *pdev,
> +			      const struct pci_device_id *id)
> +{
> +	struct pwm_lpss_boardinfo *info;

I think this should be const to mirror the type of the byt_info
variable.

> +	struct pwm_lpss_chip *lpwm;
> +	int err;
> +
> +	err = pci_enable_device(pdev);
> +	if (err < 0)
> +		return err;
> +
> +	info =  (struct pwm_lpss_boardinfo *)id->driver_data;

There's an extraneous space between '=' and '('.

Thierry

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ