aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/sm501.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2011-01-26 02:21:30 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-03-22 04:17:14 -0400
commit4295f9bf74a885da390abc49a3b42a011c1bb890 (patch)
tree6ac387cbdcacd8708611acbaab72dad1b783c90e /drivers/mfd/sm501.c
parente6a049807105decf5aa7f0c510f5e5ec96c3548e (diff)
video, sm501: add OF binding to support SM501
- add binding to OF, compatible name "smi,sm501" Signed-off-by: Heiko Schocher <hs@denx.de> cc: linux-fbdev@vger.kernel.org cc: devicetree-discuss@ozlabs.org cc: Ben Dooks <ben@simtec.co.uk> cc: Vincent Sanders <vince@simtec.co.uk> cc: Samuel Ortiz <sameo@linux.intel.com> cc: linux-kernel@vger.kernel.org cc: Randy Dunlap <rdunlap@xenotime.net> cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/mfd/sm501.c')
-rw-r--r--drivers/mfd/sm501.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 558d5f3f6d02..df3702c1756d 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1377,7 +1377,7 @@ static int __devinit sm501_init_dev(struct sm501_devdata *sm)
1377 sm501_register_gpio(sm); 1377 sm501_register_gpio(sm);
1378 } 1378 }
1379 1379
1380 if (pdata->gpio_i2c != NULL && pdata->gpio_i2c_nr > 0) { 1380 if (pdata && pdata->gpio_i2c != NULL && pdata->gpio_i2c_nr > 0) {
1381 if (!sm501_gpio_isregistered(sm)) 1381 if (!sm501_gpio_isregistered(sm))
1382 dev_err(sm->dev, "no gpio available for i2c gpio.\n"); 1382 dev_err(sm->dev, "no gpio available for i2c gpio.\n");
1383 else 1383 else
@@ -1422,6 +1422,7 @@ static int __devinit sm501_plat_probe(struct platform_device *dev)
1422 1422
1423 sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1); 1423 sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);
1424 sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0); 1424 sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
1425
1425 if (sm->io_res == NULL || sm->mem_res == NULL) { 1426 if (sm->io_res == NULL || sm->mem_res == NULL) {
1426 dev_err(&dev->dev, "failed to get IO resource\n"); 1427 dev_err(&dev->dev, "failed to get IO resource\n");
1427 ret = -ENOENT; 1428 ret = -ENOENT;
@@ -1735,10 +1736,16 @@ static struct pci_driver sm501_pci_driver = {
1735 1736
1736MODULE_ALIAS("platform:sm501"); 1737MODULE_ALIAS("platform:sm501");
1737 1738
1739static struct of_device_id __devinitdata of_sm501_match_tbl[] = {
1740 { .compatible = "smi,sm501", },
1741 { /* end */ }
1742};
1743
1738static struct platform_driver sm501_plat_driver = { 1744static struct platform_driver sm501_plat_driver = {
1739 .driver = { 1745 .driver = {
1740 .name = "sm501", 1746 .name = "sm501",
1741 .owner = THIS_MODULE, 1747 .owner = THIS_MODULE,
1748 .of_match_table = of_sm501_match_tbl,
1742 }, 1749 },
1743 .probe = sm501_plat_probe, 1750 .probe = sm501_plat_probe,
1744 .remove = sm501_plat_remove, 1751 .remove = sm501_plat_remove,