Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: dm355evm_msp: Refactoring for add_child()

Adjust jump targets according to the Linux coding style convention.
Another check for the variable "status" can be omitted then at the end.

Link: https://lkml.kernel.org/g/<20160628163146.GG29166@dell>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Markus Elfring and committed by
Lee Jones
29090265 8dcc5ff8

+9 -8
+9 -8
drivers/mfd/dm355evm_msp.c
··· 209 209 status = platform_device_add_data(pdev, pdata, pdata_len); 210 210 if (status < 0) { 211 211 dev_dbg(&pdev->dev, "can't add platform_data\n"); 212 - goto err; 212 + goto put_device; 213 213 } 214 214 } 215 215 ··· 222 222 status = platform_device_add_resources(pdev, &r, 1); 223 223 if (status < 0) { 224 224 dev_dbg(&pdev->dev, "can't add irq\n"); 225 - goto err; 225 + goto put_device; 226 226 } 227 227 } 228 228 229 229 status = platform_device_add(pdev); 230 + if (status) 231 + goto put_device; 230 232 231 - err: 232 - if (status < 0) { 233 - platform_device_put(pdev); 234 - dev_err(&client->dev, "can't add %s dev\n", name); 235 - return ERR_PTR(status); 236 - } 237 233 return &pdev->dev; 234 + 235 + put_device: 236 + platform_device_put(pdev); 237 + dev_err(&client->dev, "failed to add device %s\n", name); 238 + return ERR_PTR(status); 238 239 } 239 240 240 241 static int add_children(struct i2c_client *client)