All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for David Cohen <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	sathyanarayanan.kuppuswamy@linux.intel.com,
	david.a.cohen@linux.intel.com, tglx@linutronix.de,
	hpa@linux.intel.com
Subject: [tip:x86/intel-mid] intel-mid: sfi: allow struct devs_id.get_platform_data to be NULL
Date: Thu, 17 Oct 2013 11:19:57 -0700	[thread overview]
Message-ID: <tip-d121fa8c225b89b0ea2c126bd9db6fff51949973@git.kernel.org> (raw)
In-Reply-To: <1381896701-23476-11-git-send-email-david.a.cohen@linux.intel.com>

Commit-ID:  d121fa8c225b89b0ea2c126bd9db6fff51949973
Gitweb:     http://git.kernel.org/tip/d121fa8c225b89b0ea2c126bd9db6fff51949973
Author:     David Cohen <david.a.cohen@linux.intel.com>
AuthorDate: Tue, 15 Oct 2013 21:11:39 -0700
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 16 Oct 2013 17:16:47 -0700

intel-mid: sfi: allow struct devs_id.get_platform_data to be NULL

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>
Link: http://lkml.kernel.org/r/1381896701-23476-11-git-send-email-david.a.cohen@linux.intel.com
Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@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 2f8196d..3f1c171 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) {

  reply	other threads:[~2013-10-17 18:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  4:11 [PATCH v5 00/12] rework arch/x86/platform/[mrst => intel-mid] David Cohen
2013-10-16  4:11 ` [PATCH v5 01/12] mrst: Fixed printk/pr_* related issues David Cohen
2013-10-17 18:18   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 02/12] mrst: Fixed indentation issues David Cohen
2013-10-17 18:18   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 03/12] mrst: Fixed checkpatch warnings David Cohen
2013-10-17 18:18   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 04/12] intel_mid: Renamed *mrst* to *intel_mid* David Cohen
2013-10-17 18:18   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 05/12] " David Cohen
2013-10-17 18:19   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 06/12] intel_mid: Refactored sfi_parse_devs() function David Cohen
2013-10-17 18:19   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 07/12] intel_mid: Added custom device_handler support David Cohen
2013-10-17 18:19   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 08/12] intel_mid: Added custom handler for ipc devices David Cohen
2013-10-17 18:19   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 09/12] intel_mid: Moved SFI related code to sfi.c David Cohen
2013-10-17 18:19   ` [tip:x86/intel-mid] " tip-bot for Kuppuswamy Sathyanarayanan
2013-10-16  4:11 ` [PATCH v5 10/12] intel-mid: sfi: allow struct devs_id.get_platform_data to be NULL David Cohen
2013-10-17 18:19   ` tip-bot for David Cohen [this message]
2013-10-16  4:11 ` [PATCH v5 11/12] x86: intel-mid: add section for sfi device table David Cohen
2013-10-17 18:20   ` [tip:x86/intel-mid] " tip-bot for David Cohen
2013-10-16  4:11 ` [PATCH v5 12/12] intel_mid: Moved board related code to a new file David Cohen
2013-10-16 23:13   ` [PATCH v6 " David Cohen
2013-10-16 23:45     ` [PATCH v7 12/12] intel_mid: move board related code to their own platform_<device>.* files David Cohen
2013-10-17  2:36       ` [PATCH v8 12/12] intel_mid: move board related codes " David Cohen
2013-10-17 18:20         ` [tip:x86/intel-mid] intel_mid: move platform device definitions " tip-bot for David Cohen
  -- strict thread matches above, loose matches on Subject: below --
2013-10-17 22:35 [PATCH v10 10/12] intel-mid: sfi: allow struct devs_id.get_platform_data to be NULL David Cohen
2013-10-18  0:34 ` [tip:x86/intel-mid] intel-mid: sfi: Allow " tip-bot for 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=tip-d121fa8c225b89b0ea2c126bd9db6fff51949973@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=david.a.cohen@linux.intel.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=tglx@linutronix.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 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.