From: pavan_savoy@ti.com
To: gregkh@suse.de, alan@lxorguk.ukuu.org.uk
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Pavan Savoy <pavan_savoy@ti.com>
Subject: [PATCH] drivers:staging:ti-st: fix kim platform device id
Date: Fri, 10 Sep 2010 15:58:55 -0400 [thread overview]
Message-ID: <1284148738-21643-2-git-send-email-pavan_savoy@ti.com> (raw)
In-Reply-To: <1284148738-21643-1-git-send-email-pavan_savoy@ti.com>
From: Pavan Savoy <pavan_savoy@ti.com>
Platform devices tend to have id as -1 when only 1 device exist and
a value >=0 when multiple devices exist, since we plan to store all
these platform devices if multiple exist, there was a requirement to
have id to be >=0.
The patch fixes this problem.
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
drivers/staging/ti-st/st_kim.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
index 9e99463..be18c7a 100644
--- a/drivers/staging/ti-st/st_kim.c
+++ b/drivers/staging/ti-st/st_kim.c
@@ -638,7 +638,14 @@ static int kim_probe(struct platform_device *pdev)
long *gpios = pdev->dev.platform_data;
struct kim_data_s *kim_gdata;
- st_kim_devices[pdev->id] = pdev;
+ if ((pdev->id != -1) && (pdev->id < MAX_ST_DEVICES)) {
+ /* multiple devices could exist */
+ st_kim_devices[pdev->id] = pdev;
+ } else {
+ /* platform's sure about existance of 1 device */
+ st_kim_devices[0] = pdev;
+ }
+
kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);
if (!kim_gdata) {
pr_err("no mem to allocate");
--
1.6.5
next prev parent reply other threads:[~2010-09-10 18:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 19:58 [PATCH] drivers:staging:ti-st: patches pavan_savoy
2010-09-10 19:58 ` pavan_savoy [this message]
2010-09-10 19:58 ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st pavan_savoy
2010-09-10 19:58 ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ pavan_savoy
2010-09-10 19:58 ` [RFC 3/3] include:linux: make ti_wilink_st like the rest pavan_savoy
2010-09-16 20:00 ` Greg KH
2010-09-16 20:18 ` Savoy, Pavan
2010-09-16 20:59 ` Greg KH
2010-09-16 21:24 ` Savoy, Pavan
2010-09-16 19:57 ` [RFC 2/3] drivers:staging:ti-st: mv ti_wilink_st to include/ Greg KH
2010-09-16 19:56 ` [RFC 1/3] drivers:staging:ti-st: mv headers to ti_wilink_st Greg KH
2010-09-13 22:01 ` [PATCH] drivers:staging:ti-st: fix kim platform device id Savoy, Pavan
2010-09-15 21:38 ` Savoy, Pavan
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=1284148738-21643-2-git-send-email-pavan_savoy@ti.com \
--to=pavan_savoy@ti.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®