[PATCH V2] drivers/mtd: add powernv flash MTD abstraction driver

Neelesh Gupta neelegup at linux.vnet.ibm.com
Fri May 29 18:51:17 AEST 2015



On 05/29/2015 12:57 PM, Cedric Le Goater wrote:
> Hello,
>
> On 05/28/2015 07:25 PM, Neelesh Gupta wrote:
>>
>> On 05/28/2015 06:36 PM, Cyril Bur wrote:
>> +
>> +	rc = opal_async_wait_response(token, &msg);
>> +	opal_async_release_token(token);
>> +	if (rc) {
>> +		dev_err(dev, "opal async wait failed (rc %d)\n", rc);
>> +		return -EIO;
>> +	}
>> +
>> +	rc = be64_to_cpu(msg.params[1]);
>> +	if (rc == OPAL_SUCCESS) {
>> +		rc = 0;
>> +		if (retlen)
>> +			*retlen = len;
>> +	} else {
>> +		rc = -EIO;
>> +	}
>> +
>>
>> return rc;
> You could use opal_error_code() to convert opal codes in errnos.
>
> Also, powernv_flash_async_op() only contains low level OPAL cookery. I think
> the code would be better placed under 'arch/powerpc/platforms/powernv/' ?

The logic would unnecessary be split between the platform and driver, it 
would make
sense if the method is going to change across the platforms, but that's 
not the case.
Moreover, we will still have to export the symbol to make this work as a 
module ...

Neelesh.

>
> Cheers,
>
> C.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20150529/cb2784b3/attachment-0001.html>


More information about the Linuxppc-dev mailing list