From patchwork Thu Nov 15 06:26:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 10683613 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 88F6C14D6 for ; Thu, 15 Nov 2018 06:29:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 726562C01A for ; Thu, 15 Nov 2018 06:29:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 614432BF6D; Thu, 15 Nov 2018 06:29:04 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,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 BE6922BF6D for ; Thu, 15 Nov 2018 06:29:03 +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=AkeBrGEGNRT/hJ20I9CzEUl7RU7p8/DJN7k7aWO6ZO0=; b=ju0vAZ8Ey9eiQ4 gPaKslnWwBtmwm5pGrTr9qG0IxjyxtDEFYALMHUBYPKFiOVCQHfx9yMUBGpstGNEF4/0T5vHgOYIQ 33sVNdyp28SOt60d+PBIrWhfPexVii9B5jisEE2f+WLkXLCeX0hI8MYw7ucQEcp1t+5UOr6wFXdRU AssOiI5CzMsDWlSwwnOSz/+laTdESY9SG5i9g6QWTRgioiNZ32+eK+20Mq+0Pvak99F/27FrGnucV S8jf4HAg2v0Ut3n3w6xUNhxesAuSaVXsodKJb2qdwlRgC8DrfJehOzJzQWOis03JqlxZg6k0Y3hX0 yAI7JvhY2P/GX4RmX+MA==; 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 1gNB94-0006x5-2G; Thu, 15 Nov 2018 06:28:54 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNB7J-000564-R3; Thu, 15 Nov 2018 06:27:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OgvKSAq37dGL5lvbNqnIFovq9rMLBNjmtn+Cx+N1+Sw=; b=MqgwcBxE5mlFDuaxZ9IThWVGb MKSKdSByGSVpWsIQpmcDIqUVgFjik4+0ozvZQ2UaZpvi6rf46pktq7vQucp7D1kaPkjXVM8zeD/sN GmqvBi3mkCQnIFrUk9iiV1khEIbGJ4lIjrOJxOaTruXxrf/mSEWocY3HcNaiBS5vX8ozO3CAI1TLF dZVJyyR9oso1plByovoUqji08a6BiHFo95aG3A6RRqtYmfPRqGbyZMpy/qRVR6NKHkjZDvrdD+FFg iaE24ZiNIEfOsUZ1pcJYwtH/Gp4n5V4/3XqHzSJwv8SiEp2koTEix2H65xmUwoKbjxumEw4hEI9D4 VarHztnNg==; Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNB7G-0007HY-PO; Thu, 15 Nov 2018 06:27:04 +0000 X-UUID: b600bb10c7f04d44851bcc942b9e6235-20181115 X-UUID: b600bb10c7f04d44851bcc942b9e6235-20181115 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2143731266; Thu, 15 Nov 2018 14:26:44 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 15 Nov 2018 14:26:36 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 15 Nov 2018 14:26:37 +0800 From: Ryder Lee To: Marek Vasut , Brian Norris , Boris Brezillon Subject: [PATCH 2/4] mtd: spi-nor: mtk-quadspi: use ofpart for parsing partitions Date: Thu, 15 Nov 2018 14:26:24 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 In-Reply-To: <1dc7b27cbad59c413d7076ff7d16b6757014d727.1542262833.git.ryder.lee@mediatek.com> References: <1dc7b27cbad59c413d7076ff7d16b6757014d727.1542262833.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-20181115_062703_097507_A11970EA X-CRM114-Status: GOOD ( 15.19 ) X-BeenThere: linux-arm-kernel@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, Roy Luo , Rob Herring , linux-mtd@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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. 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)