Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1199453
| From | Michal Suchanek <hramrach@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write |
| Date | 2015-08-04 08:50 +0200 |
| Message-ID | <pTEcW-2Fk-7@gated-at.bofh.it> (permalink) |
| References | <pTwfn-81h-9@gated-at.bofh.it> <pTwfn-81h-11@gated-at.bofh.it> <pTwfn-81h-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 3 August 2015 at 23:46, Marek Vasut <marex@denx.de> wrote:
> On Monday, August 03, 2015 at 08:39:01 PM, Michal Suchanek wrote:
>> Change the return value of spi-nor device read and write methods to
>> allow returning amount of data transferred and errors as
>> read(2)/write(2) does.
>>
>> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
>> ---
>> include/linux/mtd/spi-nor.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
>> index e540952..7d782cb 100644
>> --- a/include/linux/mtd/spi-nor.h
>> +++ b/include/linux/mtd/spi-nor.h
>> @@ -185,9 +185,9 @@ struct spi_nor {
>> int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len,
>> int write_enable);
>>
>> - int (*read)(struct spi_nor *nor, loff_t from,
>> + ssize_t (*read)(struct spi_nor *nor, loff_t from,
>> size_t len, size_t *retlen, u_char *read_buf);
>> - void (*write)(struct spi_nor *nor, loff_t to,
>> + ssize_t (*write)(struct spi_nor *nor, loff_t to,
>> size_t len, size_t *retlen, const u_char *write_buf);
>> int (*erase)(struct spi_nor *nor, loff_t offs);
>
> You realize that if someone does bisect and has only this patch applied,
> the compiler will complain loudly about mismatching data types, right ? :)
Yes, the compiler prints a warning. However, only the return value
which is not used changes so it should not cause any real problem. The
data type in the fsl-quadspi and m25p80 drivers is matched in the
following two patches.
Thanks
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write Marek Vasut <marex@denx.de> - 2015-08-04 00:20 +0200 Re: [PATCH v2 1/6] mtd: spi-nor: change return value of read/write Michal Suchanek <hramrach@gmail.com> - 2015-08-04 08:50 +0200
csiph-web