diff options
Diffstat (limited to 'cds9k-gpio.c')
-rw-r--r-- | cds9k-gpio.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/cds9k-gpio.c b/cds9k-gpio.c index 80b56ac..563f3a0 100644 --- a/cds9k-gpio.c +++ b/cds9k-gpio.c @@ -9,29 +9,22 @@ static int cds9k_gpio_probe(struct platform_device *pdev) { - printk("Hello from the GPIO driver. Pdev name is %s\n", pdev->name); struct gpio_regmap_config config = {}; struct regmap *regmap; u32 base; int ret; const char *parent_name = dev_name(pdev->dev.parent); - if (!pdev->dev.parent) { - printk("NULL parent to platform device\n"); + if (!pdev->dev.parent) return -ENODEV; - } ret = device_property_read_u32(&pdev->dev, "reg", &base); - if (ret) { - printk("Failed to get u32 reg property on platform device\n"); + if (ret) return -EINVAL; - } regmap = dev_get_regmap(pdev->dev.parent, NULL); - if (!regmap) { - printk("dev_get_regmap failed\n"); + if (!regmap) return -ENODEV; - } config.parent = &pdev->dev; config.regmap = regmap; @@ -44,9 +37,7 @@ static int cds9k_gpio_probe(struct platform_device *pdev) config.reg_set_base = base + GPIO_REG_PORT; config.reg_dir_out_base = base + GPIO_REG_DIR; - printk("About to return from probe\n"); return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(&pdev->dev, &config)); - //0; } static struct of_device_id cds9k_gpio_of_match[] = { |