From: Thierry Reding <thierry.reding@gmail.com>
To: Chew Chiau Ee <chiau.ee.chew@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Alan Cox <alan@linux.intel.com>,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pwm_lpss: Add support for PCI devices
Date: Thu, 17 Apr 2014 13:08:07 +0200 [thread overview]
Message-ID: <20140417110756.GB32603@ulmo> (raw)
In-Reply-To: <1397672338-3510-1-git-send-email-chiau.ee.chew@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2497 bytes --]
On Thu, Apr 17, 2014 at 02:18:58AM +0800, Chew Chiau Ee wrote:
> From: Alan Cox <alan@linux.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@linux.intel.com>
> Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.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@intel.com>
> * Author: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
> * Author: Chew Chiau Ee <chiau.ee.chew@intel.com>
> + * Author: Alan Cox <alan@linux.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
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-04-17 11:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 18:18 [PATCH v2] pwm_lpss: Add support for PCI devices Chew Chiau Ee
2014-04-17 7:49 ` Mika Westerberg
2014-04-17 11:08 ` Thierry Reding [this message]
2014-04-17 11:16 ` One Thousand Gnomes
2014-04-17 11:34 ` Thierry Reding
2014-04-17 12:45 ` One Thousand Gnomes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140417110756.GB32603@ulmo \
--to=thierry.reding@gmail.com \
--cc=alan@linux.intel.com \
--cc=chiau.ee.chew@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.