Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2101477imu; Wed, 28 Nov 2018 22:30:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/VTUZSs4hG3tmYVa9kJ2u8O4ZfdDA1Ush8sfmqveCh1nU/U5Kf5ioDoEGw0ymf68TBy0Qoj X-Received: by 2002:a62:1212:: with SMTP id a18mr237718pfj.217.1543473055776; Wed, 28 Nov 2018 22:30:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543473055; cv=none; d=google.com; s=arc-20160816; b=y6NVenh75s4OJUvFppO2JUBK8aqXfGBMa9JscFCsu8RbiosVZdmoSTbHLBnsJq0wB+ xX8pjqYeyj9kAYUkqZQV+0/O4F1QcxvBPBHt6ATwTMP1PwtNmGwgtHSskRB8i0r9dR/L Ki0PXgfucpsz2O58g6EBtMm4CVACqqZkPCgtPTWSA3kDeAaYyT5xag6embba6SshGlvd lFz2fTgyNGpxT6cGrG6cLTtom0oCkCSFqWUIdcXcWlnrstHrjYAyvpmjezJKf/sFoowe LqDO+ptTGJDM1gMGoLe+mMd+jlZ38l3fbBZIx5ApGazglqMuUZ6aVOMATyYPfUJFyE+O ZLyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Ars10Y+6MQrfNnu/r0zfJbZuC35en+Jaqs2+XN/aPf4=; b=WCVKY9ixzQbfVl7a9yeK7MnWxWXTVhWTiHP5DFOgdqX9egHtmd2i5cgzbHOrrdZomw DZnlcpsGSYP6FR9b9/btGOBc0pXDCF2EWI87qUx+MI/z8+Tz9+nWXLnPsKEfilypCzTY Ua45tNnegdY78JfrzFqrVjPpuxfKINJmYEv2Wt2XpsuwkqcIn43yk8/ATgkwO/1/KksT y/tCWrssctVk8FtxDrlSMFrjhSv78ltmnrEWq/ZI61LmlDYDNNpJ/KHMDs1Uee4m1S4v WxpX6+xYTwuc2IsJqC7a16GQBGeFhs4bu+Dzxu0G56gOZhBz5QDP0f2QH+TN5kvKX4QS caxg== 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 w6si1145632pfb.191.2018.11.28.22.30.40; Wed, 28 Nov 2018 22:30:55 -0800 (PST) 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 S1727871AbeK2ReU (ORCPT + 99 others); Thu, 29 Nov 2018 12:34:20 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:4047 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727688AbeK2ReT (ORCPT ); Thu, 29 Nov 2018 12:34:19 -0500 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 CC: Rob Herring , Weijie Gao , , , , , , Guochun Mao 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 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) -- 1.9.1