Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324315
b: refs/heads/master
c: 19afea5
h: refs/heads/master
i:
  324313: 6663d3a
  324311: be71d61
v: v3
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Aug 16, 2012
1 parent 3d809e1 commit 4f79399
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8650bbb58062f183ce5d983b6ba4ddd1e9b67f4a
refs/heads/master: 19afea50f12b2dc5e2aaca488d1733188d06a619
32 changes: 9 additions & 23 deletions trunk/drivers/w1/masters/omap_hdq.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,33 +544,31 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)

static int __devinit omap_hdq_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct hdq_data *hdq_data;
struct resource *res;
int ret, irq;
u8 rev;

hdq_data = kmalloc(sizeof(*hdq_data), GFP_KERNEL);
hdq_data = devm_kzalloc(dev, sizeof(*hdq_data), GFP_KERNEL);
if (!hdq_data) {
dev_dbg(&pdev->dev, "unable to allocate memory\n");
ret = -ENOMEM;
goto err_kmalloc;
return -ENOMEM;
}

hdq_data->dev = &pdev->dev;
hdq_data->dev = dev;
platform_set_drvdata(pdev, hdq_data);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_dbg(&pdev->dev, "unable to get resource\n");
ret = -ENXIO;
goto err_resource;
return -ENXIO;
}

hdq_data->hdq_base = ioremap(res->start, resource_size(res));
hdq_data->hdq_base = devm_request_and_ioremap(dev, res);
if (!hdq_data->hdq_base) {
dev_dbg(&pdev->dev, "ioremap failed\n");
ret = -EINVAL;
goto err_ioremap;
return -ENOMEM;
}

hdq_data->hdq_usecount = 0;
Expand All @@ -591,7 +589,8 @@ static int __devinit omap_hdq_probe(struct platform_device *pdev)
goto err_irq;
}

ret = request_irq(irq, hdq_isr, IRQF_DISABLED, "omap_hdq", hdq_data);
ret = devm_request_irq(dev, irq, hdq_isr, IRQF_DISABLED,
"omap_hdq", hdq_data);
if (ret < 0) {
dev_dbg(&pdev->dev, "could not request irq\n");
goto err_irq;
Expand All @@ -616,16 +615,7 @@ static int __devinit omap_hdq_probe(struct platform_device *pdev)
err_w1:
pm_runtime_disable(&pdev->dev);

iounmap(hdq_data->hdq_base);

err_ioremap:
err_resource:
platform_set_drvdata(pdev, NULL);
kfree(hdq_data);

err_kmalloc:
return ret;

}

static int __devexit omap_hdq_remove(struct platform_device *pdev)
Expand All @@ -644,10 +634,6 @@ static int __devexit omap_hdq_remove(struct platform_device *pdev)

/* remove module dependency */
pm_runtime_disable(&pdev->dev);
free_irq(INT_24XX_HDQ_IRQ, hdq_data);
platform_set_drvdata(pdev, NULL);
iounmap(hdq_data->hdq_base);
kfree(hdq_data);

return 0;
}
Expand Down

0 comments on commit 4f79399

Please sign in to comment.