From patchwork Thu Nov 29 06:29:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 10704029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B81613BF for ; Thu, 29 Nov 2018 06:30:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CD632EA26 for ; Thu, 29 Nov 2018 06:30:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 207BF2EA2A; Thu, 29 Nov 2018 06:30:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C01762EA27 for ; Thu, 29 Nov 2018 06:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TrgOFRMaSciNdh/L+jNAJ6coviReKLWkSz5xw8v7vbU=; b=cjHYLXoa7DrMkT ILIwbAXgjwa4J/3aZh4Vy+f3aAa4MRo951laIiaDFc2RS+VM86eOl2IIRKTTdcI1DmYmaUJhzZruH jEEPOtFmTdU+sjPYYl0k0mHeC5kgz2/3jPvpm6I4ngVDBp7vRBZDfz2MXdOO2DCWD2KprWt4mvvq3 Pmk5//ZE09bWkBX3KG/0xxmzLR7cAmyi0YBEjV3RY6oO+zWnSMBhk2mbLtO2ghaYGQMxv2Nojw6ra sbMPKgQkNB6PTfKeSIkXN9eOg1iBGx/sCfiA0F19YEXLybageTyTudghZ/htUni4PboZcJwRTJ1j/ 7ew5qGrE0+a8zlYVapwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSFqH-0006PQ-3Y; Thu, 29 Nov 2018 06:30:29 +0000 Received: from [1.203.163.78] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSFq1-0004s5-Hl; Thu, 29 Nov 2018 06:30:15 +0000 X-UUID: 1043b3710d1c406aae6201923993d259-20181129 X-UUID: 1043b3710d1c406aae6201923993d259-20181129 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 354107526; Thu, 29 Nov 2018 14:29:58 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 29 Nov 2018 14:29:57 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 29 Nov 2018 14:29:57 +0800 From: Ryder Lee To: Marek Vasut , Brian Norris , Boris Brezillon Subject: [RESEND PATCH 2/4] mtd: spi-nor: mtk-quadspi: use ofpart for parsing partitions Date: Thu, 29 Nov 2018 14:29:54 +0800 Message-ID: <6cca6844f426d4ad4e7c878420b363cfb34499aa.1543472168.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <235ade9c5cda19fb0c9356913e3f56ad86600f59.1543472168.git.ryder.lee@mediatek.com> References: <235ade9c5cda19fb0c9356913e3f56ad86600f59.1543472168.git.ryder.lee@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_223013_804812_64E54C2A X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Guochun Mao , Weijie Gao , linux-kernel@vger.kernel.org, Rob Herring , linux-mtd@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Guochun Mao Replace mtd_device_register with mtd_device_parse_register for parsing partitions and add ofpart support. Signed-off-by: Guochun Mao Tested-by: Ryder Lee --- drivers/mtd/spi-nor/mtk-quadspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/mtk-quadspi.c b/drivers/mtd/spi-nor/mtk-quadspi.c index 5442993..2278677 100644 --- a/drivers/mtd/spi-nor/mtk-quadspi.c +++ b/drivers/mtd/spi-nor/mtk-quadspi.c @@ -118,6 +118,8 @@ struct mtk_nor { struct clk *nor_clk; }; +static const char * const probes[] = { "ofpart", NULL }; + static void mtk_nor_set_read_mode(struct mtk_nor *mtk_nor) { struct spi_nor *nor = &mtk_nor->nor; @@ -457,7 +459,7 @@ static int mtk_nor_init(struct mtk_nor *mtk_nor, if (ret) return ret; - return mtd_device_register(&nor->mtd, NULL, 0); + return mtd_device_parse_register(&nor->mtd, probes, NULL, NULL, 0); } static int mtk_nor_drv_probe(struct platform_device *pdev)