Thread (1 message) 1 message, 1 author, 2014-05-02

Re: [PATCH 2/3] net: davinci_mdio: Convert pr_err() to dev_err() call

From: Felipe Balbi <hidden>
Date: 2014-05-02 14:18:17
Also in: lkml

On Fri, May 02, 2014 at 03:50:16PM +0530, George Cherian wrote:
Convert the lone pr_err() to dev_err() call.
Also, Convert kzalloc to devm_kzalloc.

Signed-off-by: George Cherian <redacted>
---
there's a kfree(data) on davinci_mdio_remove() which could be deleted
too. Other than that:

Reviewed-by: Felipe Balbi <redacted>
quoted hunk
 drivers/net/ethernet/ti/davinci_mdio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 0cca9de..1b2e30a 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -303,7 +303,7 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
 		return -EINVAL;
 
 	if (of_property_read_u32(node, "bus_freq", &prop)) {
-		pr_err("Missing bus_freq property in the DT.\n");
+		dev_err(&pdev->dev, "Missing bus_freq property in the DT.\n");
 		return -EINVAL;
 	}
 	data->bus_freq = prop;
@@ -321,7 +321,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
 	struct phy_device *phy;
 	int ret, addr;
 
-	data = kzalloc(sizeof(*data), GFP_KERNEL);
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
 
@@ -414,8 +414,6 @@ bail_out:
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
-	kfree(data);
-
 	return ret;
 }
 
-- 
1.8.3.1
-- 
balbi

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help