diff options
Diffstat (limited to 'drivers/staging/nvec/nvec.c')
-rw-r--r-- | drivers/staging/nvec/nvec.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 90f1c4d7fa89..a93208adbfcf 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -232,8 +232,7 @@ static size_t nvec_msg_size(struct nvec_msg *msg) return 2; else if (event_length == NVEC_3BYTES) return 3; - else - return 0; + return 0; } /** @@ -807,10 +806,9 @@ static int tegra_nvec_probe(struct platform_device *pdev) } nvec = devm_kzalloc(&pdev->dev, sizeof(struct nvec_chip), GFP_KERNEL); - if (nvec == NULL) { - dev_err(&pdev->dev, "failed to reserve memory\n"); + if (nvec == NULL) return -ENOMEM; - } + platform_set_drvdata(pdev, nvec); nvec->dev = &pdev->dev; @@ -823,8 +821,8 @@ static int tegra_nvec_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { + nvec->irq = platform_get_irq(pdev, 0); + if (nvec->irq < 0) { dev_err(&pdev->dev, "no irq resource?\n"); return -ENODEV; } @@ -842,7 +840,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) } nvec->base = base; - nvec->irq = res->start; nvec->i2c_clk = i2c_clk; nvec->rx = &nvec->msg_pool[0]; @@ -895,7 +892,7 @@ static int tegra_nvec_probe(struct platform_device *pdev) } ret = mfd_add_devices(nvec->dev, -1, nvec_devices, - ARRAY_SIZE(nvec_devices), base, 0, NULL); + ARRAY_SIZE(nvec_devices), NULL, 0, NULL); if (ret) dev_err(nvec->dev, "error adding subdevices\n"); @@ -962,7 +959,7 @@ static int nvec_resume(struct device *dev) } #endif -static const SIMPLE_DEV_PM_OPS(nvec_pm_ops, nvec_suspend, nvec_resume); +static SIMPLE_DEV_PM_OPS(nvec_pm_ops, nvec_suspend, nvec_resume); /* Match table for of_platform binding */ static const struct of_device_id nvidia_nvec_of_match[] = { |