Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2097796imm; Thu, 2 Aug 2018 06:15:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd6HTS4YLa2d58xg6Sa6aD+aWAj0v3XxhR9pyZr/q+6EHDR0eo/jH4j5JwiSMMWcp0wQyS5 X-Received: by 2002:a62:9dcc:: with SMTP id a73-v6mr2860669pfk.249.1533215756071; Thu, 02 Aug 2018 06:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533215756; cv=none; d=google.com; s=arc-20160816; b=Hm+wqFO2TtYS9tOQMfHT2ATxntyB/yc9JlcaawXLXRkCCL+LMAtv9t5jsdMrjO0XlM 4wrp2rC5NdnTQffeDZAH89dkRdv5XgyEV8yEQlqAmQXB3DhEghcxQ5Eo2i3DS/h5jQXD InsM5FM80AIRfk9HvyglFfXnRdOZCywl9ejr6qcmMKjklSaSTPcGi++9JoPoiQM0DCne yaJua8Ac9plNOGYhIiNX1BRUQKDGV46KWzNCiS6oeOqoSkokDpu5HO9/nMBEPdP2Qm/w e3nJCvk1x1Ti6A9fvfkeSfr+PUaQu04GXbatYoVNbDVZYQOImHZmlEVHe9USmxiSVJjJ HYNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=PRIibLKPFslfkZvGO4HHf8NXFBBBXliPwde80CoP5UE=; b=J5US2650Cb1GGn8X+MZL8/9h10t0rKm6sabCPI9w0VRvsVv5nh7AaKuVqD1jnWkviC Sij742m+yIx8pOeYFjfnF5x4vI4mdYw0aj/0BRxj0S4gwW4q8/DWM26ZTTjOH4zDwlOD RuRpOs9PJ7cx0r8l+DBarvNG9hplnCJRM/ZmadTNm2FTMX5tWcLajjEEcW8+GwHKfBM9 6recmGkrQgqufM5/zzT7mkGGsvRBeFCKvN0Ycx+v9qG4MypPhV+Ry0hIJY+N+9b+5fqZ CehFHNqIO8nkl1Rq7iloTlSqwQJCCXIJktw/teXTBnykiw2FByQfcP1yCJVNBRJQ1kpD gKjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10-v6si1786874pfe.173.2018.08.02.06.15.41; Thu, 02 Aug 2018 06:15:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732500AbeHBPFq (ORCPT + 99 others); Thu, 2 Aug 2018 11:05:46 -0400 Received: from mail.bootlin.com ([62.4.15.54]:49203 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732298AbeHBPFp (ORCPT ); Thu, 2 Aug 2018 11:05:45 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id B264520739; Thu, 2 Aug 2018 15:14:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-89-120.w90-88.abo.wanadoo.fr [90.88.30.120]) by mail.bootlin.com (Postfix) with ESMTPSA id 53FC0206A8; Thu, 2 Aug 2018 15:14:33 +0200 (CEST) Date: Thu, 2 Aug 2018 15:14:34 +0200 From: Boris Brezillon To: Frieder Schrempf Cc: dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, richard@nod.at, broonie@kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, cyrille.pitchen@wedev4u.fr, pp@emlix.com, Zhiqiang.Hou@nxp.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Message-ID: <20180802151434.6c978937@bbrezillon> In-Reply-To: <1533214434-28761-4-git-send-email-frieder.schrempf@exceet.de> References: <1533214434-28761-1-git-send-email-frieder.schrempf@exceet.de> <1533214434-28761-4-git-send-email-frieder.schrempf@exceet.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 Aug 2018 14:53:54 +0200 Frieder Schrempf wrote: > By calling spi_mem_get_name(), the driver of the (Q)SPI controller can > set a custom name for the memory device if necessary. > This is useful to keep mtdparts compatible when controller drivers are > ported from the MTD to the SPI layer. > > Suggested-by: Boris Brezillon > Signed-off-by: Frieder Schrempf Acked-by: Boris Brezillon > --- > drivers/mtd/devices/m25p80.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c > index e84563d..aac48800 100644 > --- a/drivers/mtd/devices/m25p80.c > +++ b/drivers/mtd/devices/m25p80.c > @@ -202,6 +202,9 @@ static int m25p_probe(struct spi_mem *spimem) > if (data && data->name) > nor->mtd.name = data->name; > > + if (!nor->mtd.name) > + nor->mtd.name = spi_mem_get_name(spimem); > + > /* For some (historical?) reason many platforms provide two different > * names in flash_platform_data: "name" and "type". Quite often name is > * set to "m25p80" and then "type" provides a real chip name.