public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Eric Miao <eric.y.miao@gmail.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] pwm: pxa: Use driver_data field to store pwm_nr
Date: Mon, 01 Apr 2013 00:12:07 +0800	[thread overview]
Message-ID: <1364746327.12810.1.camel@phoenix> (raw)

The driver_data field was used to store information about PWM_ID_BASE and
HAS_SECONDARY_PWM. PWM_ID_BASE is not used now after convert to pwm framework.
This patch stores the pwm_nr in driver_data field to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pwm/pwm-pxa.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index b789882..019a8e0 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -22,13 +22,10 @@
 
 #include <asm/div64.h>
 
-#define HAS_SECONDARY_PWM	0x10
-#define PWM_ID_BASE(d)		((d) & 0xf)
-
 static const struct platform_device_id pwm_id_table[] = {
-	/*   PWM    has_secondary_pwm? */
-	{ "pxa25x-pwm", 0 },
-	{ "pxa27x-pwm", 0 | HAS_SECONDARY_PWM },
+	/*   PWM    pwm_nr */
+	{ "pxa25x-pwm", 1 },
+	{ "pxa27x-pwm", 2 },
 	{ "pxa168-pwm", 1 },
 	{ "pxa910-pwm", 1 },
 	{ },
@@ -145,7 +142,7 @@ static int pwm_probe(struct platform_device *pdev)
 	pwm->chip.dev = &pdev->dev;
 	pwm->chip.ops = &pxa_pwm_ops;
 	pwm->chip.base = -1;
-	pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1;
+	pwm->chip.npwm = id->driver_data;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (r == NULL) {
-- 
1.7.10.4




             reply	other threads:[~2013-03-31 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-31 16:12 Axel Lin [this message]
2013-04-01  7:21 ` [PATCH] pwm: pxa: Use driver_data field to store pwm_nr Eric Miao
2013-04-01  7:34   ` Axel Lin

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=1364746327.12810.1.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=eric.y.miao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@avionic-design.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox