aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Cohen <david.a.cohen@linux.intel.com>2013-10-17 18:35:34 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-10-17 19:40:59 -0400
commit0e6fdb5f036338bc38bf660c65c931b3e92a31d7 (patch)
tree134e08e73cb3c741949d6d7641f7b0b9b8ef721f /arch
parentaeedb370e7398fb5b39185b295d36f2da0653215 (diff)
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/1382049336-21316-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>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/platform/intel-mid/sfi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c
index 2f8196d38f53..3f1c171e5ce3 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 =
70 BLOCKING_NOTIFIER_INIT(intel_scu_notifier); 70 BLOCKING_NOTIFIER_INIT(intel_scu_notifier);
71EXPORT_SYMBOL_GPL(intel_scu_notifier); 71EXPORT_SYMBOL_GPL(intel_scu_notifier);
72 72
73#define intel_mid_sfi_get_pdata(dev, priv) \
74 ((dev)->get_platform_data ? (dev)->get_platform_data(priv) : NULL)
75
73/* parse all the mtimer info to a static mtimer array */ 76/* parse all the mtimer info to a static mtimer array */
74int __init sfi_parse_mtmr(struct sfi_table_header *table) 77int __init sfi_parse_mtmr(struct sfi_table_header *table)
75{ 78{
@@ -334,7 +337,7 @@ static void __init sfi_handle_ipc_dev(struct sfi_device_table_entry *pentry,
334 337
335 pr_debug("IPC bus, name = %16.16s, irq = 0x%2x\n", 338 pr_debug("IPC bus, name = %16.16s, irq = 0x%2x\n",
336 pentry->name, pentry->irq); 339 pentry->name, pentry->irq);
337 pdata = dev->get_platform_data(pentry); 340 pdata = intel_mid_sfi_get_pdata(dev, pentry);
338 341
339 pdev = platform_device_alloc(pentry->name, 0); 342 pdev = platform_device_alloc(pentry->name, 0);
340 if (pdev == NULL) { 343 if (pdev == NULL) {
@@ -367,7 +370,7 @@ static void __init sfi_handle_spi_dev(struct sfi_device_table_entry *pentry,
367 spi_info.max_speed_hz, 370 spi_info.max_speed_hz,
368 spi_info.chip_select); 371 spi_info.chip_select);
369 372
370 pdata = dev->get_platform_data(&spi_info); 373 pdata = intel_mid_sfi_get_pdata(dev, &spi_info);
371 374
372 spi_info.platform_data = pdata; 375 spi_info.platform_data = pdata;
373 if (dev->delay) 376 if (dev->delay)
@@ -391,7 +394,7 @@ static void __init sfi_handle_i2c_dev(struct sfi_device_table_entry *pentry,
391 i2c_info.type, 394 i2c_info.type,
392 i2c_info.irq, 395 i2c_info.irq,
393 i2c_info.addr); 396 i2c_info.addr);
394 pdata = dev->get_platform_data(&i2c_info); 397 pdata = intel_mid_sfi_get_pdata(dev, &i2c_info);
395 i2c_info.platform_data = pdata; 398 i2c_info.platform_data = pdata;
396 399
397 if (dev->delay) 400 if (dev->delay)
@@ -450,7 +453,7 @@ static int __init sfi_parse_devs(struct sfi_table_header *table)
450 453
451 dev = get_device_id(pentry->type, pentry->name); 454 dev = get_device_id(pentry->type, pentry->name);
452 455
453 if ((dev == NULL) || (dev->get_platform_data == NULL)) 456 if (!dev)
454 continue; 457 continue;
455 458
456 if (dev->device_handler) { 459 if (dev->device_handler) {