Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3832080pxv; Tue, 13 Jul 2021 05:01:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWcTL4s+3va7rQe5EvElk8yKbRX4dOfQKe5Z5NNPIu6z/rgYd2v0GFu99RjtJnExfNEbc7 X-Received: by 2002:a05:6e02:1527:: with SMTP id i7mr2616006ilu.134.1626177666637; Tue, 13 Jul 2021 05:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626177666; cv=none; d=google.com; s=arc-20160816; b=yDqY6N8cvCSkf06ONGtwrUEa4HzyKqzBxxnrF6nZL/lCApSobjaDq3zogkSXzLi4o3 iWOOgFV5e+7l8TkbdsCuQ2pPe6bIFO7wWOR4RMeeI2QjIG2H49GDwYeGUjzCQvx71b9Q Zwrc0uicbR6azxlmWcAoQFAsCPfX2uQuNnk3H0mSqRmP/SrIj8BqCPyvAOsEnTJ4tQ9j IhvDE3owspam2/Feju7iDLX6nXeaZBBkA+vnWyejePxL1ohq+FWptMNzsCG3We2yQOSH CfR9tyr5yVQj45OCAaKIvw+kMD1mc6Ugs++AABw2YZPwdeJohhOV4Y/nrlVQG3AzEHEh 9H7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ZYwc7tOfFYkHjOvc/uIDvmAM66/sbiI8CxrcVZg05Lk=; b=MlDwp+nWBBfa8u/xrj0oO+zTrdEoygFbhYduleSn2r7klFWMMIFH0D4UTnE3azU/wE vapqvq1Xxp9+Dn5xEWONsGGYbYxHItDflihBd3+yVUiZON0Mc9tDWI0x3v4ydh3FrBKm j1cWB1nqX80AVP932/y7CnCTr6bEWtvnaBabydilO4ubmLufQYTOSEsALVGLo0Y62X5h b08TFyi6KqLdbQOeQbRQdlHW3hglc8+YXsE2vBcHmUEO8efgISvxxpfhbN3vIOQj0SC3 2HXTiJvXhLvzbh60Kikcpe9j1tt0HPsQtyQu1wsXH7Uia4ncdMwyyQZkwTuzzuHejt5A 9v/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si10945138ils.118.2021.07.13.05.00.53; Tue, 13 Jul 2021 05:01:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235972AbhGMMC3 (ORCPT + 99 others); Tue, 13 Jul 2021 08:02:29 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:41054 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235797AbhGMMC2 (ORCPT ); Tue, 13 Jul 2021 08:02:28 -0400 X-UUID: bc9aa24003bc4abbbcb5e7b476c21f65-20210713 X-UUID: bc9aa24003bc4abbbcb5e7b476c21f65-20210713 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 748022706; Tue, 13 Jul 2021 19:59:34 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Jul 2021 19:59:22 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 13 Jul 2021 19:59:21 +0800 From: Mason Zhang To: Mark Brown , Matthias Brugger CC: , , , , , , Mason Zhang Subject: [PATCH 2/2] spi: mediatek: move devm_spi_register_master position Date: Tue, 13 Jul 2021 19:42:48 +0800 Message-ID: <20210713114247.1536-1-mason.zhang@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mason Zhang This patch move devm_spi_register_master to the end of mtk_spi_probe. If slaves call spi_sync in there probe function, master should have probe done. Signed-off-by: Mason Zhang --- drivers/spi/spi-mt65xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index b34fbc913fd6..6f2925118b98 100644 --- a/drivers/spi/spi-mt65xx.c +++ b/drivers/spi/spi-mt65xx.c @@ -820,12 +820,6 @@ static int mtk_spi_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); - ret = devm_spi_register_master(&pdev->dev, master); - if (ret) { - dev_err(&pdev->dev, "failed to register master (%d)\n", ret); - goto err_disable_runtime_pm; - } - if (mdata->dev_comp->need_pad_sel) { if (mdata->pad_num != master->num_chipselect) { dev_err(&pdev->dev, @@ -865,6 +859,12 @@ static int mtk_spi_probe(struct platform_device *pdev) dev_notice(&pdev->dev, "SPI dma_set_mask(%d) failed, ret:%d\n", addr_bits, ret); + ret = devm_spi_register_master(&pdev->dev, master); + if (ret) { + dev_err(&pdev->dev, "failed to register master (%d)\n", ret); + goto err_disable_runtime_pm; + } + return 0; err_disable_runtime_pm: -- 2.18.0