From patchwork Fri Oct 6 10:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 149192 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp231851vqo; Fri, 6 Oct 2023 03:58:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJssHEc1URhOVCcls5kGyauiuAScfgQbuPRccodXdamaX7QaWkxM7DRau6/1CTQPD+YMSU X-Received: by 2002:a05:6830:118f:b0:6bc:cd0d:427e with SMTP id u15-20020a056830118f00b006bccd0d427emr6629108otq.38.1696589910502; Fri, 06 Oct 2023 03:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696589910; cv=none; d=google.com; s=arc-20160816; b=QAXBOI2Rafm/NQcPnr7NytosSeHvZRdyd16hTsiZbgYOmx81V7eg8L1WA2aXZj0oOU dOJXfg+0DqW9Eib+n45liZN1z2gCmqAjRDF4c9rM7YlKD9HfpHaJ1rAB50Ia5x0co9sw 03p7hcWvsYLdL1rxNkTmpiYmHDxUgprqiRGcSuecgSl2yLTEiopIM7eiKRuxDczMxknf gCRn0+0k3oMYteFVQD9hYiPqnuj2Gw5IQghDndxsVX2bVX6DTxbK3huf5n2/6UhkimIH NWq3PCezUbA7gLTuag9LhhIwSt+r+03LXPjB87R15S3tQOBR0k6piep473ZdB2iu2fPF oMiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=RwPAOa96lPPVpWvIP5PI54qzk061hmQomDVoT23UNyY=; fh=wkg3aNw707R+3vA+XhVvqo40KTiysnczoHBtQFob+zQ=; b=DHPgPfLmy9+mba30svEcEYgZjayE4huiQJL5Lo0YTza8PHhtM/dZZeCv0Y4kRXCb9e 50NvAqKr4T3Nf5scrMSWZUI/LZrlvzzuiVbZUNcvfHOVO4lmVebmYEPoKuz9TrPW5xJR /f/zsGPSzs0LsKRU8q1dujns9v9MWYTam7No5FqfH4zqD0SCZqgDtP5+F0K1JaGs+qO7 PMR8liJldUC2fCLPdiBdidHUu4T6yNE075pGRMGorXI5hOxq3ZHYJu4bmNDfdpgwXj2s Ck2Zj01mzytMW3676iUcPQ2kTNBS5ykEAUYpZiLfrYKaTaTLrIb+lGNBGWXVOZiUM+Y/ UWjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eLfRYWCV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q24-20020a63d618000000b00577f50580bbsi3323941pgg.299.2023.10.06.03.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 03:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eLfRYWCV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 710DF83D8D5A; Fri, 6 Oct 2023 03:58:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231874AbjJFK6N (ORCPT + 18 others); Fri, 6 Oct 2023 06:58:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbjJFK6K (ORCPT ); Fri, 6 Oct 2023 06:58:10 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B252DB; Fri, 6 Oct 2023 03:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696589889; x=1728125889; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=xHrblxy5LJz/0z88RZl5mzsZZ2ICJvk7WRsbXXPcjSk=; b=eLfRYWCV3bGI9irzossFRI9/pg/VNjFK9yV54VSiSlbq7GbosVmYoMF0 NYeCA7aTc8HLUYOe7QPebB05miOkvZAlYW7vKcTXUF4xeUj4z5bY9IaOJ ViJL+cfyluUPt19JuP0J+E/Bzz14oIPiG9n09Q6uBjtBAkXdoc57oSrZy nx0yPvJjhINCu/I2mtsCwkOMyaEtCbBbVEe28P9XHt4yM9T/lmJj/eT71 FaaAHwMFOr5tnFBBqaZmGN97EDfXImPgeAuTKT1FWUM/ulDCEZ/Iyfu9j 8XWlcWgdKo25EWBk5LUcLkeLEdGiiPsUOr7sH6M2GgXGp8Uyn9rjbXXy7 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="363082468" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="363082468" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 03:58:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="875906267" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="875906267" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 06 Oct 2023 03:58:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5C8934F4; Fri, 6 Oct 2023 13:58:05 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/2] mmc: sdhci-pltfm: Drop unnecessary error messages in sdhci_pltfm_init() Date: Fri, 6 Oct 2023 13:58:02 +0300 Message-Id: <20231006105803.3374241-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 06 Oct 2023 03:58:28 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779003461783619651 X-GMAIL-MSGID: 1779003461783619651 The devm_platform_ioremap_resource() and platform_get_irq() print the error messages themselves and our "failed" one brings no value and just noise. Refactor code to avoid those noisy error messages. Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-pltfm.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index a72e123a585d..4d1a703a5bdb 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -115,26 +115,21 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, { struct sdhci_host *host; void __iomem *ioaddr; - int irq, ret; + int irq; ioaddr = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(ioaddr)) { - ret = PTR_ERR(ioaddr); - goto err; - } + if (IS_ERR(ioaddr)) + return ERR_CAST(ioaddr); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - ret = irq; - goto err; - } + if (irq < 0) + return ERR_PTR(irq); host = sdhci_alloc_host(&pdev->dev, sizeof(struct sdhci_pltfm_host) + priv_size); - if (IS_ERR(host)) { - ret = PTR_ERR(host); - goto err; + dev_err(&pdev->dev, "%s failed %pe\n", __func__, host); + return ERR_CAST(host); } host->ioaddr = ioaddr; @@ -152,9 +147,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, platform_set_drvdata(pdev, host); return host; -err: - dev_err(&pdev->dev, "%s failed %d\n", __func__, ret); - return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(sdhci_pltfm_init); From patchwork Fri Oct 6 10:58:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 149191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp231828vqo; Fri, 6 Oct 2023 03:58:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IED2wcqHHFaCux8Fm5LOrAFNqXIgsVQjT/fG17woVg3BnuIAiHkhXAilIe4esHubOS9avIz X-Received: by 2002:a05:6830:1414:b0:6be:fdab:dc65 with SMTP id v20-20020a056830141400b006befdabdc65mr7934440otp.19.1696589906527; Fri, 06 Oct 2023 03:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696589906; cv=none; d=google.com; s=arc-20160816; b=f7CQIv4cgsa18fKUGLaxbthCuv80lw3kZdoEbzN/LpxtYnwQVrAZGfbRXnfLHABsFo HZYY5MjPc0f+kTBQHn9jKuL5WVDiulxgfUasAC9L9Sgx1Sn/S1481KbmcouODitNl0pH R/t/bb19HEreaHv74oO7H0DhSitZgSMuWJBdGaa1tdP7BYvF0DsAgXiC8iIr1G+egUHg jCVysR7e9nZsiUdTHqzOI4qehg8TIEgttdLEpsqbFrFmNMZ5TnGWr1YWTzhiZ7ZZQu/g kl6YvtGsjcV7Vq5EsNkaocY3WGBZcPNDJx0ylA+Sf0k4HDxQ3Q60ML0lbiqF3qvgkn1g ZR1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=39cHHhHQR0Geh5q5BfeiN4Emodg5qowvd19Muwm7Gjk=; fh=wkg3aNw707R+3vA+XhVvqo40KTiysnczoHBtQFob+zQ=; b=RES0av9dQRdzFfvdt+EpTU/45RF/L4dAI7KGz7RMS3Dep3/nxAIimr+aFFROyDtJFb LOJqSqwkFmcg9uxuRHbjXvQvG5610RDu9Min6QJAZ2F6aSiDcbx094GgMK6qwqIa9q0d ilh0nNpuTwJrm+zl1uyTA8ZfkgSo7CljueZYzbOHNTpDJ0zujpRA01ReF4CxQkNtVQx1 ShENdESZxnNqwWWNeci2b+EaGcsayZj/EtjrfH8wIVedPQnGMmcz9KLEiV8RMR2n6d96 QiHqZT+Bzf1IYfwaCwVS0xyXle3HhPSx2oHp///CPevE046jNoH4NSkv2uP+6dvLeGwL aNcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLt7BjcQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 26-20020a63115a000000b00565ead2509asi926588pgr.199.2023.10.06.03.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 03:58:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLt7BjcQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A18F98145954; Fri, 6 Oct 2023 03:58:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231879AbjJFK6O (ORCPT + 18 others); Fri, 6 Oct 2023 06:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbjJFK6K (ORCPT ); Fri, 6 Oct 2023 06:58:10 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B43DDE; Fri, 6 Oct 2023 03:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696589889; x=1728125889; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=6MLMXL4M6BDsSXjfE8vIxvogcxwlXrYT4iShqFi4veI=; b=gLt7BjcQ7ti0yWSGBPQUmkX95Vqp2HkXomr7Z4H0WoO0vm4VY2r8ubTN I+0N7QfID++arH2a1wrf/rEO+U/3FjFsl2qg4h5J8JpSfGhOicchlUOQ4 bDf29M+vsLd8D8BAC7kqgZCFtiUxjYqUb/ROMv2bU7kJpTfGPNfPjEcL2 G6VgEy058vf3PcquLFuMDOPsilAwpt9NiVe3Lkd8+Kv3M+0Ga94PyhTtK B5ROYvSqYAXW1UnZr+XUQ4ZUvIEygHbETdy38g+Z1pcDNt01trrupTB9w H2y7LGZQYsFqPZBNYAsasuxUIG02KvmjsTtot/YogCAS1Ao7ftF7fLFe5 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="447915549" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="447915549" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 03:58:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="728807796" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="728807796" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 06 Oct 2023 03:58:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 86801430; Fri, 6 Oct 2023 13:58:05 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/2] mmc: sdhci-pltfm: Make driver OF independent Date: Fri, 6 Oct 2023 13:58:03 +0300 Message-Id: <20231006105803.3374241-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231006105803.3374241-1-andriy.shevchenko@linux.intel.com> References: <20231006105803.3374241-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 06 Oct 2023 03:58:24 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779003457943912242 X-GMAIL-MSGID: 1779003457943912242 Since we have device_is_compatible() API, drop OF dependency in the driver. Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-pltfm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 4d1a703a5bdb..62753d72198a 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -19,7 +19,6 @@ #include #include #include -#include #ifdef CONFIG_PPC #include #endif @@ -56,19 +55,16 @@ static bool sdhci_wp_inverted(struct device *dev) static void sdhci_get_compatibility(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct sdhci_host *host = platform_get_drvdata(pdev); - struct device_node *np = pdev->dev.of_node; - if (!np) - return; - - if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc")) + if (device_is_compatible(dev, "fsl,p2020-rev1-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_DMA; - if (of_device_is_compatible(np, "fsl,p2020-esdhc") || - of_device_is_compatible(np, "fsl,p1010-esdhc") || - of_device_is_compatible(np, "fsl,t4240-esdhc") || - of_device_is_compatible(np, "fsl,mpc8536-esdhc")) + if (device_is_compatible(dev, "fsl,p2020-esdhc") || + device_is_compatible(dev, "fsl,p1010-esdhc") || + device_is_compatible(dev, "fsl,t4240-esdhc") || + device_is_compatible(dev, "fsl,mpc8536-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; }