[SPARC64]: of_device_register() error checking fix
device_create_file() can fail. This causes the sparc64 compile to fail when my fanatical __must_check patch is applied, due to -Werror. [ Added necessary identical fix for sparc32. -DaveM] Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e47f31787d
commit
6cc8b6f51e
|
@ -695,9 +695,11 @@ int of_device_register(struct of_device *ofdev)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
device_create_file(&ofdev->dev, &dev_attr_devspec);
|
||||
rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
|
||||
if (rc)
|
||||
device_unregister(&ofdev->dev);
|
||||
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void of_device_unregister(struct of_device *ofdev)
|
||||
|
|
|
@ -922,9 +922,11 @@ int of_device_register(struct of_device *ofdev)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
device_create_file(&ofdev->dev, &dev_attr_devspec);
|
||||
rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
|
||||
if (rc)
|
||||
device_unregister(&ofdev->dev);
|
||||
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void of_device_unregister(struct of_device *ofdev)
|
||||
|
|
Loading…
Reference in New Issue