Skip to content

Commit

Permalink
mg_disk: fix error return code in mg_probe()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Jingoo Han <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Wei Yongjun authored and axboe committed Mar 28, 2013
1 parent 80b00df commit c613c5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/mg_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,10 @@ static int mg_probe(struct platform_device *plat_dev)
gpio_direction_output(host->rst, 1);

/* reset out pin */
if (!(prv_data->dev_attr & MG_DEV_MASK))
if (!(prv_data->dev_attr & MG_DEV_MASK)) {
err = -EINVAL;
goto probe_err_3a;
}

if (prv_data->dev_attr != MG_BOOT_DEV) {
rsc = platform_get_resource_byname(plat_dev, IORESOURCE_IO,
Expand Down

0 comments on commit c613c5f

Please sign in to comment.