Skip to content

Commit

Permalink
ARM: rpc: check device_register return code in ecard_probe
Browse files Browse the repository at this point in the history
device_register is marked __must_check, so we better propagate the error
value by returning it from ecard_probe.

Without this patch, building rpc_defconfig results in:

arch/arm/mach-rpc/ecard.c: In function 'ecard_probe':
arch/arm/mach-rpc/ecard.c:963:17: warning: ignoring return value of 'device_register', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Arnd Bergmann committed Oct 7, 2012
1 parent 5063557 commit 5f07809
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/arm/mach-rpc/ecard.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,9 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
*ecp = ec;
slot_to_expcard[slot] = ec;

device_register(&ec->dev);
rc = device_register(&ec->dev);
if (rc)
goto nodev;

return 0;

Expand Down

0 comments on commit 5f07809

Please sign in to comment.