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: 1005163 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Dv8J/B44"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43571p3kDSz9s3Z for ; Thu, 29 Nov 2018 17:30:38 +1100 (AEDT) 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=aPcmjdTODEQwgJ90xJIkV24XzRBkqiBjOm7j5tt+knc=; b=Dv8J/B44a8I9Jy cml6JGR10+Y/YRwG9IvghkGHqYn7Q8WocFU6U6vDNmZ6rFXQemOZRCTJfwOTS/gbk3vuNHYoGjkw/ fxW3VbX8A7A9j5u9vlG9EKZX09Rd1oUYFH3/3YBw/gQZcx9Bbf+PHPaJAKAHQt9pelwU3IPDxhmec uIbiXcv5XNbZ2UNzKlSYBYjLNpa6D3c/rdW0q7MbTkWYUxdTELdxs6SVw3m3r39wdpWD89pxNWyLj B/BghMP0O+dSrc7mrKEtJN3+AXNlVQRv3b6CJFnEdrx4JYk3CB68rR/A79gPXvKRgEls8urCUIiQO qN3PvLOAg3DmADv+Q6jw==; 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 1gSFqJ-0006Qp-2H; Thu, 29 Nov 2018 06:30:31 +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-Spam-Score: 1.3 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list 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-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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)