diff options
Diffstat (limited to 'drivers/mtd/hyperbus/rpc-if.c')
| -rw-r--r-- | drivers/mtd/hyperbus/rpc-if.c | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c index ecb050ba95cd..6e08ec1d4f09 100644 --- a/drivers/mtd/hyperbus/rpc-if.c +++ b/drivers/mtd/hyperbus/rpc-if.c @@ -124,13 +124,17 @@ static int rpcif_hb_probe(struct platform_device *pdev)  	if (!hyperbus)  		return -ENOMEM; -	rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent); +	error = rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent); +	if (error) +		return error;  	platform_set_drvdata(pdev, hyperbus);  	rpcif_enable_rpm(&hyperbus->rpc); -	rpcif_hw_init(&hyperbus->rpc, true); +	error = rpcif_hw_init(&hyperbus->rpc, true); +	if (error) +		return error;  	hyperbus->hbdev.map.size = hyperbus->rpc.size;  	hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap; @@ -150,9 +154,9 @@ static int rpcif_hb_remove(struct platform_device *pdev)  {  	struct rpcif_hyperbus *hyperbus = platform_get_drvdata(pdev);  	int error = hyperbus_unregister_device(&hyperbus->hbdev); -	struct rpcif *rpc = dev_get_drvdata(pdev->dev.parent); -	rpcif_disable_rpm(rpc); +	rpcif_disable_rpm(&hyperbus->rpc); +  	return error;  }  |