Thread (5 messages) 5 messages, 3 authors, 2011-09-14

Re: [PATCH v3 1/2] i2c: s3c2410: Keep a copy of platform data and use it

From: Stephen Boyd <hidden>
Date: 2011-09-13 07:01:17
Also in: linux-arm-kernel, linux-i2c, linux-samsung-soc

On 9/12/2011 9:16 PM, Thomas Abraham wrote:
quoted hunk ↗ jump to hunk
@@ -809,6 +810,15 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
+	i2c->pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+	if (!i2c->pdata) {
+		ret = -ENOMEM;
+		goto err_noclk;
+	}
+
+	if (pdata)
+		memcpy(i2c->pdata, pdata, sizeof(*pdata));
+
Is there a devm_kmemdup()? If not, maybe it would be a good idea to add it.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help