Re: [PATCH] mtd: m25p80: Modify the name of mtd_info
From: Scott Wood <hidden>
Date: 2014-03-21 17:35:14
From: Scott Wood <hidden>
Date: 2014-03-21 17:35:14
On Fri, 2014-03-21 at 19:16 +0800, Hou Zhiqiang wrote:
@@ -1009,8 +1012,17 @@ static int m25p_probe(struct spi_device *spi) if (data && data->name) flash->mtd.name = data->name; - else - flash->mtd.name = dev_name(&spi->dev); + else{
Whitespace
+ ret = of_address_to_resource(mnp, 0, &res);
+ if (ret) {
+ dev_err(&spi->dev, "failed to get spi master resource\n");
+ return ret;
+ }
+ flash->mtd.name = kasprintf(GFP_KERNEL, "spi%x.%d",
+ (unsigned)res.start, spi->chip_select);Don't use "unsigned" by itself. Don't cast physical addresses to "unsigned int" -- use "unsigned long long". -Scott