From patchwork Mon Sep 30 22:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 831759 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD990184527; Mon, 30 Sep 2024 22:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727736565; cv=none; b=HVpUbhxrIxbdLmc3rgy9Hj2t10aS9r64hLtAA3GhF36RChA5v6+TOUNgYdGCgpV5l67TqL/D7KTeXmZiJrFodXP/e2r2V98SMR+RjDCJPHNZl6X8RRGTWzoROB7lDXcv/yjG6OeQipWuj1fT+Yhg9DnbAtoQB8QnSDXQMPxT+XQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727736565; c=relaxed/simple; bh=7beLImfiluII2Fa9nkM9GIIxG++SJvby8fZ0yUcC9eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZJC4LXJzg6HSldoZy5eaYI5PWyc4Kb8mj6sVGLea3g5y7fJQdL58G0t9JuTQV5B6wrR2TAjMuXYAC9CUE6VFKtobzbO/fywdugUliXoy+qgLkXiJ9yBBB5W8M45G59sVB8VyF5HcZhhefvgTXXvhmYATO2SlmU0DNDxu2EzJYLM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZTP1cYkX; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZTP1cYkX" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7db4c1a54easo3068021a12.1; Mon, 30 Sep 2024 15:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727736563; x=1728341363; darn=vger.kernel.org; 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=skvYEbeiJmt7JWU7QhjcNmw9hjLxF9pjRq94Mk/8yjI=; b=ZTP1cYkXmpoeZnz4XewQqJYv9ncXUDUnLWWgH1W8lxaAl9v5ySvkYKsBsasbVD9pzW yJXuMaPDlcgA5VAmauOUVU+Fa3i+H83TJmOPA7CR4C6Np3rRW+KMgLmc9SFYuUan9NTW WWJ3MQOQIwBGeB6QTIJ/RzZPhkmgZc4iuGsGhWvnT5/nV0p3xOBQS3lgE6gkgKUgzLRM gEBSLOhz+FEZEe2iym/5wGRf3Pr/wTVyxJz06tz5xmIy3ZhcLC+LUBWB5Qlr2qvAITnL Usr7py0TfcMLlNmccgdNY38vAtHFXnd/doJNfw42qDwjSQrLNxH1ZHCrb9zGV52N6Bgi rCQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727736563; x=1728341363; 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=skvYEbeiJmt7JWU7QhjcNmw9hjLxF9pjRq94Mk/8yjI=; b=PnCG6uGX3A/NBJvfJY2gh2+0EuartyQ3w+s2szK62jtwmumMiMSoGnaG6LClT3OXGD gJVudAURjSxIkChGR3zt28/KIyuzj9uud4itIwSizGso5QTUsRr0rQGhbCisvFPmH6wG ri9lfRIqPZF3mWR10rwVJoq+5HaY0IHfDHzb5tk7JaMhK0B+iEUImG8W9n/nr+pbF3DI wHtpJR2cW2tGqdKsRZDbHKk3O9DsBqxqRfJ9XdCzU0YuNBNdCRcvcxIFjuxy7L4WTkBn CZdFqkqN8ODy0np7ARdjYJCmQ4SrrNLT1muzhUXw9v5AqOMqV5G7UNKAqft4BEn/ElKO Emww== X-Forwarded-Encrypted: i=1; AJvYcCU/fZ2WPP/BneZK6XFPb1D6ZWa1GAcnsocavZMdfbW8+3+m2HihzYKqUuMd7ZbWYmY/2VaqJBCke718dHQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0rmNwIeSZovwaVEkGwTEZy7Vl/n9sjJqoyflnkQ3lr6TmPx1W sAB25vmtbmGgM7fRS7bwTF23vnCO2fB3naC0YJQbaJO/idaEJLYIyG8NHzMy X-Google-Smtp-Source: AGHT+IF/baAIksfObpO4d/Xeo/VELBA77lvmXKRc0oDEsxehbkabpfd0djPIxu6XGEybAlbj2bEx1Q== X-Received: by 2002:a05:6a20:e188:b0:1d2:e78d:214a with SMTP id adf61e73a8af0-1d4fa7d0f19mr19113109637.44.1727736563173; Mon, 30 Sep 2024 15:49:23 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2b391bsm7029528a12.22.2024.09.30.15.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 15:49:22 -0700 (PDT) From: Rosen Penev To: linux-mmc@vger.kernel.org Cc: Chaotian Jing , Ulf Hansson , Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH 1/3] mmc: mtk-sd: use devm_mmc_alloc_host Date: Mon, 30 Sep 2024 15:49:17 -0700 Message-ID: <20240930224919.355359-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930224919.355359-1-rosenp@gmail.com> References: <20240930224919.355359-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Allows removing several gotos. Also fixed some wrong ones. Added dev_err_probe where EPROBE_DEFER is possible. Signed-off-by: Rosen Penev --- drivers/mmc/host/mtk-sd.c | 55 ++++++++++++++------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 89018b6c97b9..c607312dfe07 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2736,20 +2736,18 @@ static int msdc_drv_probe(struct platform_device *pdev) } /* Allocate MMC host for this device */ - mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev); + mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(struct msdc_host)); if (!mmc) return -ENOMEM; host = mmc_priv(mmc); ret = mmc_of_parse(mmc); if (ret) - goto host_free; + return ret; host->base = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(host->base)) { - ret = PTR_ERR(host->base); - goto host_free; - } + if (IS_ERR(host->base)) + return PTR_ERR(host->base); res = platform_get_resource(pdev, IORESOURCE_MEM, 1); if (res) { @@ -2760,18 +2758,16 @@ static int msdc_drv_probe(struct platform_device *pdev) ret = mmc_regulator_get_supply(mmc); if (ret) - goto host_free; + return ret; ret = msdc_of_clock_parse(pdev, host); if (ret) - goto host_free; + return ret; host->reset = devm_reset_control_get_optional_exclusive(&pdev->dev, "hrst"); - if (IS_ERR(host->reset)) { - ret = PTR_ERR(host->reset); - goto host_free; - } + if (IS_ERR(host->reset)) + return PTR_ERR(host->reset); /* only eMMC has crypto property */ if (!(mmc->caps2 & MMC_CAP2_NO_MMC)) { @@ -2783,30 +2779,24 @@ static int msdc_drv_probe(struct platform_device *pdev) } host->irq = platform_get_irq(pdev, 0); - if (host->irq < 0) { - ret = host->irq; - goto host_free; - } + if (host->irq < 0) + return host->irq; host->pinctrl = devm_pinctrl_get(&pdev->dev); - if (IS_ERR(host->pinctrl)) { - ret = PTR_ERR(host->pinctrl); - dev_err(&pdev->dev, "Cannot find pinctrl!\n"); - goto host_free; - } + if (IS_ERR(host->pinctrl)) + return dev_err_probe(&pdev->dev, PTR_ERR(host->pinctrl), + "Cannot find pinctrl"); host->pins_default = pinctrl_lookup_state(host->pinctrl, "default"); if (IS_ERR(host->pins_default)) { - ret = PTR_ERR(host->pins_default); dev_err(&pdev->dev, "Cannot find pinctrl default!\n"); - goto host_free; + return PTR_ERR(host->pins_default); } host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs"); if (IS_ERR(host->pins_uhs)) { - ret = PTR_ERR(host->pins_uhs); dev_err(&pdev->dev, "Cannot find pinctrl uhs!\n"); - goto host_free; + return PTR_ERR(host->pins_uhs); } /* Support for SDIO eint irq ? */ @@ -2895,14 +2885,14 @@ static int msdc_drv_probe(struct platform_device *pdev) GFP_KERNEL); if (!host->cq_host) { ret = -ENOMEM; - goto host_free; + goto release_mem; } host->cq_host->caps |= CQHCI_TASK_DESC_SZ_128; host->cq_host->mmio = host->base + 0x800; host->cq_host->ops = &msdc_cmdq_ops; ret = cqhci_init(host->cq_host, mmc, true); if (ret) - goto host_free; + goto release_mem; mmc->max_segs = 128; /* cqhci 16bit length */ /* 0 size, means 65536 so we don't have to -1 here */ @@ -2939,11 +2929,8 @@ static int msdc_drv_probe(struct platform_device *pdev) host->dma.gpd, host->dma.gpd_addr); if (host->dma.bd) dma_free_coherent(&pdev->dev, - MAX_BD_NUM * sizeof(struct mt_bdma_desc), - host->dma.bd, host->dma.bd_addr); -host_free: - mmc_free_host(mmc); - + MAX_BD_NUM * sizeof(struct mt_bdma_desc), + host->dma.bd, host->dma.bd_addr); return ret; } @@ -2968,9 +2955,7 @@ static void msdc_drv_remove(struct platform_device *pdev) 2 * sizeof(struct mt_gpdma_desc), host->dma.gpd, host->dma.gpd_addr); dma_free_coherent(&pdev->dev, MAX_BD_NUM * sizeof(struct mt_bdma_desc), - host->dma.bd, host->dma.bd_addr); - - mmc_free_host(mmc); + host->dma.bd, host->dma.bd_addr); } static void msdc_save_reg(struct msdc_host *host) From patchwork Mon Sep 30 22:49:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 832315 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8144218C925; Mon, 30 Sep 2024 22:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727736566; cv=none; b=RgyFR96nDzVlKcL8qaTJVE7V1xx7yIvS+RUa3UH/37LcPh4NY8EIIK2FeenB9K7ld9grymxS8aPZSwbDTBPirTAHdE8CdmZDtQnhM4wunzbwB8o3sqsmBifQIjRd7JM+SVsNm0fxdPlO9anvYLvuwTvj9B3gS7ekOxWhPA6L1dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727736566; c=relaxed/simple; bh=3Ga0pMcYTazUGfOy5XosUE5WnrMAU2JB2bWuVVb68j8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FeOdLje+t173ogV7so7ZD+LKoMBt2GTNFLxEsLkjSywDotCTfLMwG1QilY9GemXBejIQ144dmrTb14EScxauPsQIfKntguO3qnjdCQSBmbhXJn1PNRaq4Jw9NzmM12TIIpvnb0S/9cCB6sZQK8RKSu0ecDkfep0uTp7Ly0+mgs0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ManilrdF; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ManilrdF" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-718e6299191so2588514b3a.2; Mon, 30 Sep 2024 15:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727736564; x=1728341364; darn=vger.kernel.org; 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=V0LZHtqzBnIuZo9WgI5XN+fZbaiOF80rdjBOKI8JpkM=; b=ManilrdFR6J0GdgnKB73TpUhTVNEd3qCddXfKkhBXVW18P23HUkVr5ypMGMiV3Vdlg T08dxK5qHU+1TiqR5XqlU8D4O+GIKb/Q90SuU1gBMt6AjQYpbejDPknCjni0+OC6DhjA RxXdSy/OY7navmTzP76D1pqzSJJYhTwl0Mu6eGdqWOp3c6iyDGKG0pH4WK2h3fbv2dRk Zf+Z8aRD0pslDkK1AENbQ61HhMEPh7o1D5wS0lzEz9yEsQDhtpoxu3MjIGy1qeTo6D2b nOydNhv0wtp7GCUG9s7+Rf9TBfHr4TXMm2msckIXzOpOkr0hido4PiqL9PFzFN14mEnp EwbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727736564; x=1728341364; 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=V0LZHtqzBnIuZo9WgI5XN+fZbaiOF80rdjBOKI8JpkM=; b=kBev/kJAJzrhqLDpxfZZyeWy1/umDXGCn9Qfbs8gN6zVQWF1CPgH++9E/f61id0gI3 FFUYFSKpcHjPxAffE4mbhn1PMy4ITqcT4V/LNe/kpnRjxLqBKtugCLPNPDRPmqJEIQOK v152sy45aUdcOEDEhVmHSnoD+ui95uskZeaCF5tY91itqktFRoOmt89WoCU+tNwyWv0+ KNqEwxtcMlBB/aTFTMG+wOEoTrfHU9pLEEPJDbJ3T0LM3nbym8xCNjABotnCPQCGdLc8 UNf9n4cSxjIJSSC03qlmxmm6mURfeEBJVPmv3tHOoZlupnKh7J8sX9/w1qUXucDXqqF/ uP6w== X-Forwarded-Encrypted: i=1; AJvYcCUS+Anpe78fhZE41Ef/EkwMiiQvp15Bhvrz/tgAA8LXFvmR9G0vOIcFf9csoxCN7JTM3aC6gTy4SQrc7js=@vger.kernel.org X-Gm-Message-State: AOJu0Yzw+veskMJePY9lFfuAOUeZnqsRW8z0DxjjSZRKAn25n2c+fBdI aEESlA5twqNAsKuD+7EghhnkA2xMwNYpYbvYJuof2kxL1vfC0tw7GoZUp95i X-Google-Smtp-Source: AGHT+IF6EvgE3gl8ueVWIB0I3k9SSFxraUPAgWsvgxyqSPIjf5c8FhCRNnG4kbQalUudlk0nUl/+bQ== X-Received: by 2002:a05:6a20:d48b:b0:1cf:4ad8:83b9 with SMTP id adf61e73a8af0-1d4fa7dfa7amr21216746637.43.1727736564582; Mon, 30 Sep 2024 15:49:24 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2b391bsm7029528a12.22.2024.09.30.15.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 15:49:24 -0700 (PDT) From: Rosen Penev To: linux-mmc@vger.kernel.org Cc: Chaotian Jing , Ulf Hansson , Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH 2/3] mmc: mtd-sd: use devm_platform_ioremap_resource Date: Mon, 30 Sep 2024 15:49:18 -0700 Message-ID: <20240930224919.355359-3-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930224919.355359-1-rosenp@gmail.com> References: <20240930224919.355359-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 My guess is some automated tool missed this transformation. Now looks clearer as do what's happening. Also allows removal of struct resource. Signed-off-by: Rosen Penev --- drivers/mmc/host/mtk-sd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index c607312dfe07..4be13b9c2d71 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2727,7 +2727,6 @@ static int msdc_drv_probe(struct platform_device *pdev) { struct mmc_host *mmc; struct msdc_host *host; - struct resource *res; int ret; if (!pdev->dev.of_node) { @@ -2749,12 +2748,9 @@ static int msdc_drv_probe(struct platform_device *pdev) if (IS_ERR(host->base)) return PTR_ERR(host->base); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (res) { - host->top_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(host->top_base)) - host->top_base = NULL; - } + host->top_base = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(host->top_base)) + host->top_base = NULL; ret = mmc_regulator_get_supply(mmc); if (ret) From patchwork Mon Sep 30 22:49:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 831758 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD565199250; Mon, 30 Sep 2024 22:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727736568; cv=none; b=VKKtwlt+/ER12MZPpINDOANN0sbR3BnXvXw5AOWfdQZZ9i6tfE1HgmymVcQJ39GFwQXpTGv0AzRLCWkXk54h6NgjO5PoqVmc3KdYCYuts8sucCggMXilySlSH4l5kzPAuC8kgUclpO6rPSQwuVtV4wp9cZZbfQBG9ag2AGSSV7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727736568; c=relaxed/simple; bh=Gq0meupMf4uNZynkIrN+2DXwDY4YMP79KPdl4VGKl7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=keHqxyrrlZi9WI4ktRp6OLe3L239uH1YMRlE9ePmSpoR8z6UUik53pcYkjXTe7mPueXK9mFgalqrhNxlpyVRVTaNQWBzGhXLVQPQVzS3UORDKI/C788lNI89IyOSL1558OoQ1PKeCZW+yKiaS/oV7g4ZS0bHt0N9z1aHOkzWEhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nV/n1isp; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nV/n1isp" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-7198de684a7so3373203b3a.2; Mon, 30 Sep 2024 15:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727736566; x=1728341366; darn=vger.kernel.org; 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=n+VM5TZSFztMjLb3KAfFJRsMesVIdyYR2yr/sMtsQkw=; b=nV/n1ispH4SQ1Gomn/sodYQ5cNtz/IhRyYoe8yW/iIaZXHxl6UWJYg3PWiYPCdfznB nR+yQg+uSE0ZwYuuV/B3oOzyPLBYpW4NiP7sDJ1MiaReAF1E9bMQ6d/Vtxchfx5Q9rjM xaAO+JvGOzcETxXfI834bnLIstGTBB9NmmdmATuHJGh7ksvGCeVSC/o3pNbIuZvgF3zH cPgmSxWWTNrjKLQhqsPJ2pLaWnsEY3S+5VrHVTQWOvpOPsp5Tvf/3GT1SLPYJ6HeyPcs +SSMpvjIM4kKaXxQfrTKXZnp5/de1yodaVEtpmAZkGsCk4VTQCFppI+em+F7brzHtG6x zihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727736566; x=1728341366; 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=n+VM5TZSFztMjLb3KAfFJRsMesVIdyYR2yr/sMtsQkw=; b=L6ElCdHz2xXd2RAxrcuDWa96mbT8dPewZnGZrWT2hbypoULeqLi6g32oMxDfvfnBNj gfngAna2Cq1yPfnf8ep1RXg2KYm/OLaEI+r8Fnjlheve55xwF5GEMheHAp6mqcQugvL/ UyvlOScbyyx12lfWZAUlB1QItdOSTrO7ddzFC5Qw1Sj7m6NWG3DvzGPQkbeRiyfURooP so2qnvgj0lN0lyL9ofx6DZRxiYqdyGk2lLsRjMJlA6q77iWaqX2iMyuOErgU2Iz+Pc/v eOzdA3CTwGC478Munanq/3LUfhphBDAQrLBJOoMkAcI9eyKudT1977rchx7feMj0AVjn RXFw== X-Forwarded-Encrypted: i=1; AJvYcCU9KRlHOXFgFzjehJfyjedfPvLWrB0xbNW1lClqKt0yVu4W4P/CApQwISjFQEnI1TBXaDFARxU7l2Dd/So=@vger.kernel.org X-Gm-Message-State: AOJu0YxITHNkyxUZINOCI/4TqSrboAu9ZE7VlgHGXZZS7KqSJpK8IbUN RcAKwy2MSvyJTTA4kyu8RzdkYOnLxEgZnxtZxGFMRzP8wgIBneQAxphwWGoS X-Google-Smtp-Source: AGHT+IHB+v9R3OPGcEtIwwUWx+aIIBEO/ORAGhDYlWynhw4/iVHFD/CvPXAdYHoa+7TwSGXOYGMmSQ== X-Received: by 2002:a05:6300:4041:b0:1cf:3a0a:ae45 with SMTP id adf61e73a8af0-1d4fa7ae36emr22105311637.35.1727736566076; Mon, 30 Sep 2024 15:49:26 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2b391bsm7029528a12.22.2024.09.30.15.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 15:49:25 -0700 (PDT) From: Rosen Penev To: linux-mmc@vger.kernel.org Cc: Chaotian Jing , Ulf Hansson , Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH 3/3] mmc: mtk-sd: fix devm_clk_get_optional usage Date: Mon, 30 Sep 2024 15:49:19 -0700 Message-ID: <20240930224919.355359-4-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930224919.355359-1-rosenp@gmail.com> References: <20240930224919.355359-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This already returns NULL when not found. However, it can return EPROBE_DEFER and should thus return here. Signed-off-by: Rosen Penev --- drivers/mmc/host/mtk-sd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 4be13b9c2d71..b02cbae96e89 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2769,9 +2769,8 @@ static int msdc_drv_probe(struct platform_device *pdev) if (!(mmc->caps2 & MMC_CAP2_NO_MMC)) { host->crypto_clk = devm_clk_get_optional(&pdev->dev, "crypto"); if (IS_ERR(host->crypto_clk)) - host->crypto_clk = NULL; - else - mmc->caps2 |= MMC_CAP2_CRYPTO; + return PTR_ERR(host->crypto_clk); + mmc->caps2 |= MMC_CAP2_CRYPTO; } host->irq = platform_get_irq(pdev, 0);