From: David Cohen <david.a.cohen@linux.intel.com>
To: x86@kernel.org, hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org,
David Cohen <david.a.cohen@linux.intel.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: [PATCH v9 12/14] intel-mid: sfi: allow struct devs_id.get_platform_data to be NULL
Date: Thu, 17 Oct 2013 14:55:55 -0700 [thread overview]
Message-ID: <1382046957-15987-13-git-send-email-david.a.cohen@linux.intel.com> (raw)
In-Reply-To: <1382046957-15987-1-git-send-email-david.a.cohen@linux.intel.com>
Intel mid sfi code doesn't need struct devs_id.get_platform_data != NULL.
If the callback is not set, just assume there is no platform_data.
Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
arch/x86/platform/intel-mid/sfi.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c
index 0cf574b..5950051 100644
--- a/arch/x86/platform/intel-mid/sfi.c
+++ b/arch/x86/platform/intel-mid/sfi.c
@@ -70,6 +70,9 @@ struct blocking_notifier_head intel_scu_notifier =
BLOCKING_NOTIFIER_INIT(intel_scu_notifier);
EXPORT_SYMBOL_GPL(intel_scu_notifier);
+#define intel_mid_sfi_get_pdata(dev, priv) \
+ ((dev)->get_platform_data ? (dev)->get_platform_data(priv) : NULL)
+
/* parse all the mtimer info to a static mtimer array */
int __init sfi_parse_mtmr(struct sfi_table_header *table)
{
@@ -334,7 +337,7 @@ static void __init sfi_handle_ipc_dev(struct sfi_device_table_entry *pentry,
pr_debug("IPC bus, name = %16.16s, irq = 0x%2x\n",
pentry->name, pentry->irq);
- pdata = dev->get_platform_data(pentry);
+ pdata = intel_mid_sfi_get_pdata(dev, pentry);
pdev = platform_device_alloc(pentry->name, 0);
if (pdev == NULL) {
@@ -367,7 +370,7 @@ static void __init sfi_handle_spi_dev(struct sfi_device_table_entry *pentry,
spi_info.max_speed_hz,
spi_info.chip_select);
- pdata = dev->get_platform_data(&spi_info);
+ pdata = intel_mid_sfi_get_pdata(dev, &spi_info);
spi_info.platform_data = pdata;
if (dev->delay)
@@ -391,7 +394,7 @@ static void __init sfi_handle_i2c_dev(struct sfi_device_table_entry *pentry,
i2c_info.type,
i2c_info.irq,
i2c_info.addr);
- pdata = dev->get_platform_data(&i2c_info);
+ pdata = intel_mid_sfi_get_pdata(dev, &i2c_info);
i2c_info.platform_data = pdata;
if (dev->delay)
@@ -450,7 +453,7 @@ static int __init sfi_parse_devs(struct sfi_table_header *table)
dev = get_device_id(pentry->type, pentry->name);
- if ((dev == NULL) || (dev->get_platform_data == NULL))
+ if (!dev)
continue;
if (dev->device_handler) {
--
1.8.4.rc3
next prev parent reply other threads:[~2013-10-17 21:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-17 21:55 [PATCH v9 00/14] rework arch/x86/platform/[mrst => intel-mid] David Cohen
2013-10-17 21:55 ` [PATCH v9 01/14] mrst: Fixed printk/pr_* related issues David Cohen
2013-10-17 21:55 ` [PATCH v9 02/14] mrst: Fixed indentation issues David Cohen
2013-10-17 21:55 ` [PATCH v9 03/14] mrst: Fixed checkpatch warnings David Cohen
2013-10-17 21:55 ` [PATCH v9 04/14] intel_mid: Renamed *mrst* to *intel_mid* David Cohen
2013-10-17 21:55 ` [PATCH v9 05/14] intel_mid: fix coccinelle warnings David Cohen
2013-10-17 21:55 ` [PATCH v9 06/14] intel_mid: Renamed *mrst* to *intel_mid* David Cohen
2013-10-17 21:55 ` [PATCH v9 07/14] intel_mid: Refactored sfi_parse_devs() function David Cohen
2013-10-17 21:55 ` [PATCH v9 08/14] intel_mid: Added custom device_handler support David Cohen
2013-10-17 21:55 ` [PATCH v9 09/14] intel_mid: Added custom handler for ipc devices David Cohen
2013-10-17 21:55 ` [PATCH v9 10/14] intel_mid: Moved SFI related code to sfi.c David Cohen
2013-10-17 21:55 ` [PATCH v9 11/14] intel_mid: fix coccinelle warnings David Cohen
2013-10-17 21:55 ` David Cohen [this message]
2013-10-17 21:55 ` [PATCH v9 13/14] x86: intel-mid: add section for sfi device table David Cohen
2013-10-17 21:55 ` [PATCH v9 14/14] intel_mid: move board related codes to their own platform_<device>.* files David Cohen
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=1382046957-15987-13-git-send-email-david.a.cohen@linux.intel.com \
--to=david.a.cohen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=x86@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
Powered by JetHome