Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5026021pxv; Wed, 28 Jul 2021 01:00:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE2FDvGk8ozHK1WTgAsXO1GOk7JUr8Z9fuMHPXkwaxiHAPA7KHeeq8eBPBzqRlIpLJ3JVx X-Received: by 2002:a05:6e02:13d3:: with SMTP id v19mr20147273ilj.167.1627459241798; Wed, 28 Jul 2021 01:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627459241; cv=none; d=google.com; s=arc-20160816; b=NXOTyDxyWvtZZwk99BjtUSsqdgA3ACQEOCZq1hIjMYmnO2ZTtTJVGDlyqlWTuwSH2T dDqKgb2D9IvwBm3ohAtE/tmi84Q3rIhRVbAkvmuhfN0sgqH526Zsotv2L1tlR44yMZeA P0TJ9//lVAFgS7XhoIBmRSrebvPlEfYCBDJLqjlHXThLBelulG8FVTk+4QRk4VQqEeoX pHuyoHTmSXFphjUGhtt3mMHPJLldcNNq431e/DicJ4swsIGSQOCbCAdm2I7nKoDePDV/ aeGEZRqIGcskhKC+q9/hkGlrf/xl8kLlYMtRLwKj4FMO3j/TJmokgYt68imbPTfUPEqN 2tvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=FsniMzf68olW9MGsS5jqODz39NWd1bwCdnl/Bxfsmsg=; b=KaSVwwNDBPtPmqhMRxC6New6OBWRd1TbVPLw2bAHPxG4umhRYyKmzrHchgRpiJ60VO IbhDkfkzAVosIcGi8iwBRuRy8WC4UNtoJuCycsOw5vzywQM/tFCQCTobYGtfoAg3nLUe dvB9ZZz5zi/hQHSMdnJQCp/IEW1K+CqRh4jS3tYa60PrS/JlKcbDPdnqd0+HhIOLQdcm wtoxsgyHuOA0LH32OZTx+9JctO7ukV+ZgoZJCyN862wM3BASSvTUeUptnsVCmejx4TJl MNPNW16KlFwD4UupetAGsi108HyedR4yE0s1Jx6TGkvWTEB5UxOHUPeHskrmTMUKofOb pBJw== 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 p20si6351277ioo.40.2021.07.28.01.00.30; Wed, 28 Jul 2021 01:00:41 -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 S235124AbhG1H7X (ORCPT + 99 others); Wed, 28 Jul 2021 03:59:23 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:38220 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234976AbhG1H7N (ORCPT ); Wed, 28 Jul 2021 03:59:13 -0400 X-UUID: 2f212d9a80fe4dae90f0a6737a9b5976-20210728 X-UUID: 2f212d9a80fe4dae90f0a6737a9b5976-20210728 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 542538601; Wed, 28 Jul 2021 15:59:07 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 28 Jul 2021 15:59:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 28 Jul 2021 15:59:05 +0800 From: Chunfeng Yun To: Vinod Koul , Rob Herring , Chun-Kuang Hu CC: Chunfeng Yun , Kishon Vijay Abraham I , Philipp Zabel , Matthias Brugger , , , , , , , Eddie Hung Subject: [PATCH 4/9] phy: phy-mtk-tphy: print error log using child device Date: Wed, 28 Jul 2021 15:58:26 +0800 Message-ID: <1627459111-2907-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1627459111-2907-1-git-send-email-chunfeng.yun@mediatek.com> References: <1627459111-2907-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Print error log using child devices instead of parent device. Signed-off-by: Chunfeng Yun --- drivers/phy/mediatek/phy-mtk-tphy.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index a6502058a1a5..9d4b34298137 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -1278,6 +1278,7 @@ static int mtk_tphy_probe(struct platform_device *pdev) for_each_child_of_node(np, child_np) { struct mtk_phy_instance *instance; struct clk_bulk_data *clks; + struct device *subdev; struct phy *phy; instance = devm_kzalloc(dev, sizeof(*instance), GFP_KERNEL); @@ -1295,16 +1296,17 @@ static int mtk_tphy_probe(struct platform_device *pdev) goto put_child; } + subdev = &phy->dev; retval = of_address_to_resource(child_np, 0, &res); if (retval) { - dev_err(dev, "failed to get address resource(id-%d)\n", + dev_err(subdev, "failed to get address resource(id-%d)\n", port); goto put_child; } - instance->port_base = devm_ioremap_resource(&phy->dev, &res); + instance->port_base = devm_ioremap_resource(subdev, &res); if (IS_ERR(instance->port_base)) { - dev_err(dev, "failed to remap phy regs\n"); + dev_err(subdev, "failed to remap phy regs\n"); retval = PTR_ERR(instance->port_base); goto put_child; } @@ -1317,7 +1319,7 @@ static int mtk_tphy_probe(struct platform_device *pdev) clks = instance->clks; clks[0].id = "ref"; /* digital (& analog) clock */ clks[1].id = "da_ref"; /* analog clock */ - retval = devm_clk_bulk_get_optional(&phy->dev, TPHY_CLKS_CNT, clks); + retval = devm_clk_bulk_get_optional(subdev, TPHY_CLKS_CNT, clks); if (retval) goto put_child; -- 2.18.0