From patchwork Mon Jun 10 01:12:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 802953 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1734943wro; Sun, 9 Jun 2024 18:16:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBG0ZS6qtM4IQEUpOmmgd3gKZDqFOJAKAUH4tvUbnvHqL5cy56Uj3n+mbcoppVyrpc2gBFDFmLCoK2x5ZruImh X-Google-Smtp-Source: AGHT+IHRrEHukOThQedi/kydkOxxpnKz7yUpK7fzt1T+bGXQ7RrvyTSsldVhvdb66wnWDhxHGuT3 X-Received: by 2002:a17:906:f5a8:b0:a6f:21cd:9a91 with SMTP id a640c23a62f3a-a6f21cda3f4mr54515666b.69.1717982183744; Sun, 09 Jun 2024 18:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717982183; cv=none; d=google.com; s=arc-20160816; b=SVak2r9qjPiAPjcurE8OgCdjTuj7N7aGVnjhWjn/QC3ZWCAamD5QFwkVhm5wrcIcHZ BU0f+cYBfX1vXCUQ2GSjPXF+9oJvRZzeJHELVsuxmyL0zySM1PPY489aKA3Ve9azSa2x bV7qa272v2tU5hHixoZe0EBIusiQ9qMrChGbLo1DMOXLnVm05UHvRPs3QLA/64q+2wp4 mtuHajJuY94o5o+TlpIYR7zM2cjKEZnNCMTGzEu1w1+LFGXeVRZ3akkT+59rU8TUtCbO eckZR77UjbMHbfYU+B5NkvxSLTzhzgAmPI2O7P8e4vrE5f49WPhtEQkaDJpOwux2OX3c qryg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=roWRK/rU+GAWWadjVAp6QeIoYQp30k3brzMlJdJKnGA=; fh=bnpxbEoBw0hyP/oVuEpYLRy1FnfmpPuc2n3nr2VMWqc=; b=hjm/CzjM/smE8W2fXKQsY9WieWYKM1aYwJyJpcON2w+XHJ3atCEDExSpkzFbGcPNYL 6ErN8ClWF6D3SZgJOoHD+0Jy1aUEHs3IN57FsByQFr4RVGL1vE/FtLfrW7nBSRvNo9LW 6kM/8RyTL4Njs0eKS4nkTZ097cmG+GHc4qmaxSXZj9w6sVbj4mYPYbVwiuB3+lb6xYgM ORBVNIsacu87xoh/MeSjM5YQYStwuQFVJ5CaVwd6zbD+xAph7W/m9CoV89FJLIIMJ/84 Ocp1TFFymPyYM0+HiEebfuGtMDHzUoKs10GF5NeHIoeyQOkJll8dix3mTIwO5XHGr14v 3g7g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZUdkgGvn; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef53ff3fdsi258733766b.168.2024.06.09.18.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 18:16:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZUdkgGvn; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9C7988541; Mon, 10 Jun 2024 03:12:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZUdkgGvn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5ED3188468; Mon, 10 Jun 2024 03:12:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 46116884C5 for ; Mon, 10 Jun 2024 03:12:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-24c9f628e71so1992945fac.1 for ; Sun, 09 Jun 2024 18:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717981963; x=1718586763; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=roWRK/rU+GAWWadjVAp6QeIoYQp30k3brzMlJdJKnGA=; b=ZUdkgGvnrgZ2ZI5a668+x5ElOVAui39aEln/qfQEGpWKIZ89HK7crxKIP6Jrdnqjyc ROS4fsIv0u0K8ht7PseMRSgHxHo+Ngt7llwl9ZgbstNenC6uO2Eiv43PPLdgBGkzV/q7 JW+Ni86vPJuNjKTjngEo5eITwfLiFj0aMziP94yTw95OR+EUrZl2xkw66muOMH+3h/y0 OEy3lCa4oPxYGqKDE3lELlzMSLOsjPOG619JohReQzpWbWxR4Kr7QS539g37oK4+j022 s+t+ZvVznbKZVRu4rLJr8D0IT6w9X8i9pqGttBYZ96OegeDmmPgD/4oFzRpzH6tvnO/q QQsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717981963; x=1718586763; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=roWRK/rU+GAWWadjVAp6QeIoYQp30k3brzMlJdJKnGA=; b=HDYHXfiUTJ2VaYunWjlLfthAA6dNXN+GIDUhGcoI3cc3zq6EAw3mCv9h6jZaPTwtfw geW2JmTFEJTvT8G3buxeaCWwPlm2A2RSUiZsp+BufFjK4bY1eHe6yd7IjBFmuQoPQQ9Z gGrFAVmBOG9M8GQj7p9+JImewQLOtGAyueMq8kh+SaHY6ee+AnTsJBU77AbVbYCBjUOk 7KAMGvdOaQl/NN5LJX/PdpjfjEBnAwYKyb0Ti6/zAGJq38JAq4g4I1lqYSpEF41Xfgmy TmxWcrfYaavIegVu84SgBFILXFO8Gp7Rvw2BQULtkTLnoVdqgthbyFCWaEG3vK8E0Z4u gkJQ== X-Forwarded-Encrypted: i=1; AJvYcCWrGqvjG6EPITnkvBHqUinIbge/bnv9FGj4c/+x76aRr9rwKVqt73uKcF23u09ngRWGByRbxWDXLFbqyLxyerwEDFZWQw== X-Gm-Message-State: AOJu0Yw94sikF24APPAHTJ0bP/8DfLAG9ojhLS7k+/VRMVFMb82WeExG OiaJUAxqeAIubAoYSiDITiWJTfCSqSF7ZvqjZx+XI2EQ8mzDedI+YWNlM0D+xHI= X-Received: by 2002:a05:6870:55ca:b0:254:a9bd:70b2 with SMTP id 586e51a60fabf-254a9bdcf5cmr4076841fac.59.1717981963054; Sun, 09 Jun 2024 18:12:43 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-6f9896fbfcfsm615803a34.34.2024.06.09.18.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 18:12:42 -0700 (PDT) From: Sam Protsenko To: Tom Rini , Minkyu Kang , Peng Fan , Jaehoon Chung , Simon Glass Cc: Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v2 22/40] mmc: exynos_dw_mmc: Use .of_to_plat for device tree parsing Date: Sun, 9 Jun 2024 20:12:08 -0500 Message-Id: <20240610011226.4050-23-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610011226.4050-1-semen.protsenko@linaro.org> References: <20240610011226.4050-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean exynos_dwmci_get_config() is called from the probe function and used to read data from device tree. Make use of .of_to_plat driver callback instead, and convert exynos_dwmci_get_config() to match its signature. No functional change. Signed-off-by: Sam Protsenko --- drivers/mmc/exynos_dw_mmc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index de39a8d7f3c1..95c64b9eda54 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -224,10 +224,13 @@ static int do_dwmci_init(struct dwmci_host *host) return exynos_dwmci_core_init(host); } -static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, - int node, struct dwmci_host *host, - struct dwmci_exynos_priv_data *priv) +#ifdef CONFIG_DM_MMC +static int exynos_dwmmc_of_to_plat(struct udevice *dev) { + const void *blob = gd->fdt_blob; + struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); + struct dwmci_host *host = &priv->host; + int node = dev_of_offset(dev); int err = 0; u32 timing[3]; @@ -287,7 +290,6 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, return 0; } -#ifdef CONFIG_DM_MMC static int exynos_dwmmc_probe(struct udevice *dev) { struct exynos_mmc_plat *plat = dev_get_plat(dev); @@ -302,10 +304,6 @@ static int exynos_dwmmc_probe(struct udevice *dev) return err; #endif - err = exynos_dwmci_get_config(dev, gd->fdt_blob, dev_of_offset(dev), - host, priv); - if (err) - return err; err = do_dwmci_init(host); if (err) return err; @@ -336,6 +334,7 @@ U_BOOT_DRIVER(exynos_dwmmc_drv) = { .name = "exynos_dwmmc", .id = UCLASS_MMC, .of_match = exynos_dwmmc_ids, + .of_to_plat = exynos_dwmmc_of_to_plat, .bind = exynos_dwmmc_bind, .ops = &dm_dwmci_ops, .probe = exynos_dwmmc_probe,