Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1870981rdb; Tue, 20 Feb 2024 09:17:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWHLk8NQknHecEB7EEuT2EY39UR9FrvhAjleN6pMLtkbIhDM59J+gWBN/voOb+K2Syzxg60ahzpx39JuSh4z+Oa77xRaNGJewJd9I0n9g== X-Google-Smtp-Source: AGHT+IHKOxSI81xGbosIsqyFOCj+TkUnfXGlNh9aCkVwWTylCtJDYz75qighAf3ViVyA73JYWEM9 X-Received: by 2002:a17:906:f745:b0:a3e:422d:a27d with SMTP id jp5-20020a170906f74500b00a3e422da27dmr6360783ejb.47.1708449470572; Tue, 20 Feb 2024 09:17:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708449470; cv=pass; d=google.com; s=arc-20160816; b=SFCFeuX9eBNQmJHTTNXpajlD1NICdfldF2u4c3soQKhfVsOKy9yQ6tpMri2qDMOzYG 4gnHwoy0hNtrarkZXm8s4+hv5I0iFUICR3FMBvvzr78RzIZU6Yw1vGqC6YipD7LNZ8TX G1Pvho5DEuO91rJlOJFp7ahwhs/JfHvXDiHemkiLBRKpQsuY0AQt1sTrxCkrMddk0YQJ MOKVyCiVGxKWoKPrkepau1zTtQ0KGmmMz4ZJgfoUsZSuMFUenwh9VRwqM7kD4tAKEfL8 tPHcd8gu6GapxrXgv1hT+PRpGQhCAl/ClNJxZosHauBZS7leOgLfdEek0CYSljv1GJ27 qbWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=kLl58GIIciXgEo+F5tfKYBWriEo8VOczQcbGvTzHojw=; fh=+eX4TjCq0bM7+fT42zn5AST1W6HQ10pDjpMPgxrxFiw=; b=u8pBO/G4CUQdft3fIYKjEUo3Y+0Qa4Nhr/psg2TZQy6PKRL1HsD9ysaWUQI2M5Qdfk faS1wsnaAiITdO/9TO/xxoeXwfWiUQjz5S+tFJ7Rpw1emi1AEmkRhshEZvuEgVgghzeR 7fu62L/LsoSSNK0blsWn1+hW40Msn6sl76dC43UscbKq63SWIP9qNYP+XizW+Jl/XVKS qhIZuf/TpHTEnAVxjxvZo47znEi0SJty1GwdPSdefxxNCUqxMwG9jT/INoVxjpxP4fyu QhE8GL1Eh39e5fmEbtFVf7J+GiIwr0QokjgZSjEa1iLl1IPdaIhP1lKKCT8swJkcQET2 6a5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-kernel+bounces-73417-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73417-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ce3-20020a170906b24300b00a3e4575e5f6si2940165ejb.893.2024.02.20.09.17.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 09:17:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73417-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-kernel+bounces-73417-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73417-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 33DBE1F22086 for ; Tue, 20 Feb 2024 17:17:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3B2376C9C; Tue, 20 Feb 2024 17:17:34 +0000 (UTC) Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4C9576C87; Tue, 20 Feb 2024 17:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=141.14.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708449454; cv=none; b=IalLkhV+gIvnpPT2YqgDONOxvZiDDquIEF6OcIawAbJDpq3E98qPr4pIBgTImnkeMyxw53qzqivOwvMfguBfBUJScdKqLHp+/oEcv2BP3+w2jVJgEiUbSOzCW43LOSe2wUWkyizeP/AGR/ecTXuiiKTrQmb7D2FAkXztCtL+gqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708449454; c=relaxed/simple; bh=96ksfqWINydkRiMCjGad2oGhzIwnfo2QrZw43uLx3is=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ogfO68XttrSf5yiHGSn+y5MiRtrCWVBuB4/WQaY5rEqLC4D4To6LaGf3o0A5Fkl1vGF2p23srbzh+aXBcRL2Y9t8EMKpNt1dhz1yDGtaBNuzHs+njYjWM36xW78T1iCu0IbhHkBaL9T11hifwUr8dtrMUJmd8oJHyZu64zEhn6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de; spf=pass smtp.mailfrom=molgen.mpg.de; arc=none smtp.client-ip=141.14.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Received: from [141.14.220.34] (g34.guest.molgen.mpg.de [141.14.220.34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 2098E61E5FE01; Tue, 20 Feb 2024 18:16:40 +0100 (CET) Message-ID: <26acdacd-e63b-494f-bf7d-215b8643a0c5@molgen.mpg.de> Date: Tue, 20 Feb 2024 18:16:37 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mmc: host: replace 1st argument to struct device * for mmc_of_parse_clk_phase() Content-Language: en-US To: Yang Xiwen Cc: Ulf Hansson , Andrew Jeffery , Adrian Hunter , Joel Stanley , linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240215-mmc_phase-v1-1-f27644ee13e4@outlook.com> From: Paul Menzel In-Reply-To: <20240215-mmc_phase-v1-1-f27644ee13e4@outlook.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Dear Yang, Thank you very much for your patch. Some nits from my side. For the summary, I suggest: > mmc: host: mmc_of_parse_clk_phase(): Pass struct device * instead of mmc_host * Am 15.02.24 um 12:03 schrieb Yang Xiwen via B4 Relay: > From: Yang Xiwen > > Parsing dt usaully happens very early, sometimes even bofore struct 1. us*ua*lly 2. b*e*fore > mmc_host is allocated (e.g. dw_mci_probe() and dw_mci_parse_dt() in > dw_mmc.c). Looking at the source of mmc_of_parse_clk_phase(), it's > actually not mandatory to have a initialized mmc_host first, instead we a*n* > can pass struct device * to it directly. > > Also fix the only current user (sdhci-of-aspeed.c). > > Signed-off-by: Yang Xiwen > --- > drivers/mmc/core/host.c | 4 +--- > drivers/mmc/host/sdhci-of-aspeed.c | 2 +- > include/linux/mmc/host.h | 2 +- > 3 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > index cf396e8f34e9..8b2844ac5dc5 100644 > --- a/drivers/mmc/core/host.c > +++ b/drivers/mmc/core/host.c > @@ -234,10 +234,8 @@ static void mmc_of_parse_timing_phase(struct device *dev, const char *prop, > } > > void > -mmc_of_parse_clk_phase(struct mmc_host *host, struct mmc_clk_phase_map *map) > +mmc_of_parse_clk_phase(struct device *dev, struct mmc_clk_phase_map *map) > { > - struct device *dev = host->parent; > - > mmc_of_parse_timing_phase(dev, "clk-phase-legacy", > &map->phase[MMC_TIMING_LEGACY]); > mmc_of_parse_timing_phase(dev, "clk-phase-mmc-hs", > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c > index 42d54532cabe..430c1f90037b 100644 > --- a/drivers/mmc/host/sdhci-of-aspeed.c > +++ b/drivers/mmc/host/sdhci-of-aspeed.c > @@ -435,7 +435,7 @@ static int aspeed_sdhci_probe(struct platform_device *pdev) > goto err_sdhci_add; > > if (dev->phase_desc) > - mmc_of_parse_clk_phase(host->mmc, &dev->phase_map); > + mmc_of_parse_clk_phase(&pdev->dev, &dev->phase_map); > > ret = sdhci_add_host(host); > if (ret) > diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h > index 2f445c651742..5894bf912f7b 100644 > --- a/include/linux/mmc/host.h > +++ b/include/linux/mmc/host.h > @@ -539,7 +539,7 @@ struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra); > int mmc_add_host(struct mmc_host *); > void mmc_remove_host(struct mmc_host *); > void mmc_free_host(struct mmc_host *); > -void mmc_of_parse_clk_phase(struct mmc_host *host, > +void mmc_of_parse_clk_phase(struct device *dev, > struct mmc_clk_phase_map *map); > int mmc_of_parse(struct mmc_host *host); > int mmc_of_parse_voltage(struct mmc_host *host, u32 *mask); Reviewed-by: Paul Menzel Kind regards, Paul