From patchwork Thu Aug 8 03:14:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 817684 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp675414wrt; Wed, 7 Aug 2024 20:18:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUer8FyP1DmgVst3Mi1oI4A48HKpZiKe+Ckvt1IhX2YNY9h12pbNzL57Mu8OFSMBZr7QIMNfRaEgxpiPlipNnVe X-Google-Smtp-Source: AGHT+IEtshd5rnwq+NfWxRun3JEGQW88yY6l2JcFhJz61XPtJHQzIf2H4/Xm5gE77Xt2yHot4Xo0 X-Received: by 2002:a05:6402:3509:b0:5a2:abcb:c4cf with SMTP id 4fb4d7f45d1cf-5bbb21eca39mr463355a12.22.1723087115561; Wed, 07 Aug 2024 20:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723087115; cv=none; d=google.com; s=arc-20160816; b=s/4DqHqlmqA9ag4yYC/YcaxZCtMXaev9Fihn8upiMilG9ANwEk8/oOqJYOFD8sFC6m vHNWIUZ580adkHB0Lk6fxjG2XRqgsQdecBkidjR75/UtdMBLiMOFveYLZ+ZEipi7qkxa ByVMY7Vsu26/Wl/Xj4NjRBG9/tAWzqFeadjenMK5MdmmBVyMGakBz6dAQ/wO+0+incMc 3lJLRqklPAie8A6LlCZ29osQAXecOqiuy3jUwyf0wzNfDTgplj8WB+VPa7UVgLGCBB71 /kgbmYxU0T1ILEIbHsvimFAJmL4pgcGGjaRab+js5KAeSZTrVqPfggtX8DxD4xA2bZkX fFHw== 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=sgGukJlNcf0K2Z5Fvf+KW1N0Z6A0j+D44vCIr+vTCLw=; fh=Gu/9pttbmlIRQd69BIO50p1StjsFUPNUddBtmcOaLtw=; b=SY/U93kOxVY/dO+mrVgRWNSd2HRYW3cm8UTM0RTstaUDFYZ4IK5p9Es412l1DCtrxH gccMpOeOctSE45HRzFfpZXOhWZ6jziCgxeMTHvzfNj+scbOa5BQsEkyJS0pclj1x7u3J y62OcoA/EGHeF/LuduTdA0mEFBSIqe7Po5ChGtKz32loIo0bbfjNdpDHhSApoHNdik8K fLK28ZBiW2uKKYtGbn7onew+6lhKo16MXYdFV8oF1DwJi65aJfA6SVANbDVyFbzEYftb kgP6Om+G8fUjYN9rF4OjfipNvgPnU6016hwIJLb1WYq90O6pF08wdZigsz4LQVhwluk8 sC9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="LTh/Ngcy"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5bbb2e38d77si238100a12.577.2024.08.07.20.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:18:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="LTh/Ngcy"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F3D188BB4; Thu, 8 Aug 2024 05:15:12 +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="LTh/Ngcy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0CFC68873C; Thu, 8 Aug 2024 05:15:05 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (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 E574988AE0 for ; Thu, 8 Aug 2024 05:15:01 +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-oi1-x229.google.com with SMTP id 5614622812f47-3db16129143so366302b6e.0 for ; Wed, 07 Aug 2024 20:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723086900; x=1723691700; 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=sgGukJlNcf0K2Z5Fvf+KW1N0Z6A0j+D44vCIr+vTCLw=; b=LTh/Ngcy7ysNebxg0QgMXCb0nSYslRPxuOz8GNXbc+icnFkwLUBUcHYDR5cnUSexez uaD7i6tmHVqcj6Mwc47kGw87x9pxRWx6WWTJ6IPTIpssYl5rvx62labta6w/a3pths3B fGK0A0YL0yh3h/uKTUh6cGKdjB3N53bqr6ikP7jgLLElPGjFOCrpnrIbieGKx8TYimwM Ywnw7xMvVCM97S1FmK2Te+9pP5mbOeHBs0pizAysm3sRPBueviAfNmf1TBWWOBdV7jlg WasDERjmwARG+JIuMnkjiszapXjZ031Z1SGqBNV7LFFAXnCI9J8QQHet+PqzKSiBMr/0 c5kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723086900; x=1723691700; 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=sgGukJlNcf0K2Z5Fvf+KW1N0Z6A0j+D44vCIr+vTCLw=; b=rTPKnJ4wSmR17YE0H2mc7pEmspIEvMVtL3cKBcWVLEuE3Qtpc+QKM7M6ZyxsE17bO/ OJAyvjEHI8GPlWR7skBH4dpkXnosptD5lLz1/Y/4x4X+R73WwiIWUef+5LGGhbw1sfTP NMXPJyNJtSha4JM+7drNMXJLCaLqYClSHGmeKQVM3vV9BP1J1Cg0Jq/+AV8UHsJbymKx ikc4zGKBKHpqoskx7MVi3sNeEd8ZEWtwyrHlUpD5F5gaSwZKyJAgW7r+txJT0Iw87Nqg yoOBRRgtHKa00/RKgtkKP5V+D4UjpbFLmHjq+5873aN8Z6khG8Ph6BpeumtAveigxDZh scnQ== X-Forwarded-Encrypted: i=1; AJvYcCWDpMQKKCielbTzsr3zWyoHwfEFVTaCUjMaUsYymeQNyKJqsIugxNQzLRgH1LmnZwxmsSH5kZPDhhtJk4kLr1G7jPiZ3Q== X-Gm-Message-State: AOJu0YwM7RGy2/0h5KdEkA3ArN+YqVzVl1vnM5HBRBwZJdBupJ0wpiwc +76yJ5PbAAt+ubo+hY/6WVudOW4wW7M20wDyXPHKg5rujsKW7XtMxoNNbZPLF4U= X-Received: by 2002:a05:6808:13d2:b0:3d9:2b24:5b2 with SMTP id 5614622812f47-3dc3b1c4ad0mr744092b6e.0.1723086900335; Wed, 07 Aug 2024 20:15:00 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db56361b99sm4612825b6e.11.2024.08.07.20.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:15:00 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang , Jaehoon Chung Cc: Tom Rini , Henrik Grimler , Peng Fan , Simon Glass , 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 v5 21/38] mmc: exynos_dw_mmc: Use .of_to_plat for device tree parsing Date: Wed, 7 Aug 2024 22:14:27 -0500 Message-Id: <20240808031444.9619-22-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240808031444.9619-1-semen.protsenko@linaro.org> References: <20240808031444.9619-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 --- Changes in v5: - (none) Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - (none) 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 4d28ede0d756..09a59fdf0120 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -223,10 +223,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]; @@ -286,7 +289,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); @@ -301,10 +303,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; @@ -335,6 +333,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,