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

From: Neelesh Gupta <[email-masked]>
Date: Fri, 29 May 2015 14:21:17 +0530

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.