Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2073555imm; Thu, 2 Aug 2018 05:56:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdwGQcYs5mi7hleFZTc1rxmdhPZCJ0bhkk4xgLA6RYlE9W5TfEGaVSSrAR0ljwfaUQdSi8m X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr2739551pgg.49.1533214599969; Thu, 02 Aug 2018 05:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533214599; cv=none; d=google.com; s=arc-20160816; b=0JJSiaZNiWGSszVgacmhUcOM0whVJfFtbpan0JLDs4olihfjGEDtqdBeRYfQgCISg/ KcGm09E1NWylB96ApYldWdAv0NjH23bPdB9KuU9BgkISHz+BafP6n37mAwHTtFgHefXc 20U2VrDLMsNCZTBL8yVWiLJXKq+eo1aEHW7qbjJBwY+rENCobypH19Mn59j+CS8fIcLR iNZDcaCWWfcFdnLvWmh0SoqpSowmpgV4RIXZHe8OqsDQFez4rTMD7f0TP9rDaZc+6aE1 SHSeiEk7PMdZqc2xQhaB6BVlmyjOC4+CpsOpUhjMefIoPGrpC/yxrW7nA/hRBfjGRYL0 +yQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Z+3vqqSZo8xz681gBxM4nJCvZiYwbbDIV18OBHmuLzM=; b=e80yKcOk8SU7sIumY9FnIscGTknfam+NXJy6soJIHNtVsOvbH/j+WYM9WvmJEBJbp6 9OQbgPNej586NrT0ChDOJSotqliKYRakvfnF9zLYJ1NX1krqUmgG3T6fQE1Ief11TpV/ W5qdz6t8n/TW+SUeiQ4Ll0jbkoDWzJ3j3qvz++V5bnaLtdowkWdG7sH4yqhMZpNzyh4r wKmEfZyrhpPsG5/9x5yCyiO7nknQhQEiCnoC8kFN+3KJUdzzewZerXSRC+Hvhzvu63/b UR1S6lZ8ODaoee3d4Jb/AUPVgKOSismFvuhpQXP8uuSMSqcNUIZ6bVh+UcBUh7qRUP7Y 8TlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@as-electronics.de header.s=strato-dkim-0002 header.b=WG0iEYde; 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 w3-v6si394586plq.61.2018.08.02.05.56.24; Thu, 02 Aug 2018 05:56:39 -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; dkim=fail header.i=@as-electronics.de header.s=strato-dkim-0002 header.b=WG0iEYde; 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 S2387546AbeHBOpp (ORCPT + 99 others); Thu, 2 Aug 2018 10:45:45 -0400 Received: from mo4-p05-ob.smtp.rzone.de ([81.169.146.182]:17108 "EHLO mo4-p05-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387491AbeHBOpo (ORCPT ); Thu, 2 Aug 2018 10:45:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1533214479; s=strato-dkim-0002; d=as-electronics.de; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Z+3vqqSZo8xz681gBxM4nJCvZiYwbbDIV18OBHmuLzM=; b=WG0iEYdebqdbKaHv5sp87J2alnZKWH5FGGQvy6GvdzSLE7FJYaJAEo4DF9UvX6N6Ux XBXkJKTk/YPLf0MH6R5wD8mFnu2knJdBrRW8z1Owdb95GD3Ypxv8Ql5xKGQcdg4CU74H In7aWDKtLClqWBmq7HIBajq15ao7kEVmHPVGSU3pWiYrQy5gNI5B3+DukyNfFw2exiPJ Eq7MuOw7ft67BxuhbdfBv2eY3MNdCxvWPH1HUqyhT+CZPXim7JWg3GGJmf4QEYBWRKpR IA/zwFt6mlCQ5/cMmxMOwjeqD/vJz+5yqjRdsRBDKjCdpb4YhcYmBDquYyvohKXR3jR/ aILg== X-RZG-AUTH: ":LX8JdEmkW/4tAFwMkcNJIloh1hrA5u3owhPk7bdT5Fx22AatU+eLaHfutoZdl+X9BETxn4/4+IVqx+ReE5zXU1i255vGQvjM+ToVYx2MGL/3gV0P3t0=" X-RZG-CLASS-ID: mo05 Received: from fs-work.fritz.box by smtp.strato.de (RZmta 43.14 AUTH) with ESMTPSA id Z0998bu72CsU7Pf (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 2 Aug 2018 14:54:30 +0200 (CEST) From: Frieder Schrempf To: dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@bootlin.com, marek.vasut@gmail.com, richard@nod.at, broonie@kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org Cc: cyrille.pitchen@wedev4u.fr, frieder.schrempf@exceet.de, pp@emlix.com, Zhiqiang.Hou@nxp.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name Date: Thu, 2 Aug 2018 14:53:54 +0200 Message-Id: <1533214434-28761-4-git-send-email-frieder.schrempf@exceet.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533214434-28761-1-git-send-email-frieder.schrempf@exceet.de> References: <1533214434-28761-1-git-send-email-frieder.schrempf@exceet.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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. -- 2.7.4