aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/sm501.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2011-01-26 07:21:30 +0000
committerPaul Mundt <lethal@linux-sh.org>2011-03-22 17:17:14 +0900
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 558d5f3f6d0..df3702c1756 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)
sm501_register_gpio(sm);
}
- if (pdata->gpio_i2c != NULL && pdata->gpio_i2c_nr > 0) {
+ if (pdata && pdata->gpio_i2c != NULL && pdata->gpio_i2c_nr > 0) {
if (!sm501_gpio_isregistered(sm))
dev_err(sm->dev, "no gpio available for i2c gpio.\n");
else
@@ -1422,6 +1422,7 @@ static int __devinit sm501_plat_probe(struct platform_device *dev)
sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);
sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
if (sm->io_res == NULL || sm->mem_res == NULL) {
dev_err(&dev->dev, "failed to get IO resource\n");
ret = -ENOENT;
@@ -1735,10 +1736,16 @@ static struct pci_driver sm501_pci_driver = {
MODULE_ALIAS("platform:sm501");
+static struct of_device_id __devinitdata of_sm501_match_tbl[] = {
+ { .compatible = "smi,sm501", },
+ { /* end */ }
+};
+
static struct platform_driver sm501_plat_driver = {
.driver = {
.name = "sm501",
.owner = THIS_MODULE,
+ .of_match_table = of_sm501_match_tbl,
},
.probe = sm501_plat_probe,
.remove = sm501_plat_remove,