From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0206.outbound.protection.outlook.com [207.46.163.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 54C502C0082 for ; Sat, 22 Mar 2014 04:35:14 +1100 (EST) Message-ID: <1395423296.12479.354.camel@snotra.buserror.net> Subject: Re: [PATCH] mtd: m25p80: Modify the name of mtd_info From: Scott Wood To: Hou Zhiqiang Date: Fri, 21 Mar 2014 12:34:56 -0500 In-Reply-To: <1395400578-5637-1-git-send-email-B48286@freescale.com> References: <1395400578-5637-1-git-send-email-B48286@freescale.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Cc: linuxppc-dev@ozlabs.org, mingkai.hu@freescale.com, linux-mtd@lists.infradead.org, dwmw2@infradead.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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