From patchwork Fri Jan 20 15:44:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 645410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28C18C25B4E for ; Fri, 20 Jan 2023 15:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbjATPoJ (ORCPT ); Fri, 20 Jan 2023 10:44:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjATPoI (ORCPT ); Fri, 20 Jan 2023 10:44:08 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66D5559264; Fri, 20 Jan 2023 07:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674229447; x=1705765447; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oBVSJGdmqluJ+m0kpxYQdXUIQZYypRK6F57krHn+9Cs=; b=LVhdOo43ck4HjZ8K7sa6VjjR/sf/qeAD5nK1IOTcOqW741LcPgsuztJP 4s7RuWtrC4gt9D5C4D+QfGhV6Ct42fCaQNIacOWYcfpEgwT/8jj4K7YGV FNPpJVSACLKedwMxEFmzCXNbMUTtZGCPzxJGmneGha+Rz21qVqdwT3sF7 pSCb4m+m79DKHAb3PmuRvMerA6vuXIEAfyOD4aSppGXO6oWZVHfnGffeg lo/tPDQgGjAALOroCFGb2i4gNLY+ApMoQK90vEHPC+bxTaRYiz03w7O02 mWt4OrJRmk1CcRajMzYfFd6+7LF/NFJ9Iw4nvxLs5tJ+cynfiFhsqTAHS g==; X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="390114958" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="390114958" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 07:44:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="989427700" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="989427700" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 20 Jan 2023 07:44:04 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E7A85368; Fri, 20 Jan 2023 17:44:39 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 1/5] usb: fotg210-hcd: use sysfs_emit() to instead of scnprintf() Date: Fri, 20 Jan 2023 17:44:33 +0200 Message-Id: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/usb/fotg210/fotg210-hcd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index 7bd1e8f3080d..46752a75c428 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -4686,14 +4686,11 @@ static ssize_t uframe_periodic_max_show(struct device *dev, struct device_attribute *attr, char *buf) { struct fotg210_hcd *fotg210; - int n; fotg210 = hcd_to_fotg210(bus_to_hcd(dev_get_drvdata(dev))); - n = scnprintf(buf, PAGE_SIZE, "%d\n", fotg210->uframe_periodic_max); - return n; + return sysfs_emit(buf, "%d\n", fotg210->uframe_periodic_max); } - static ssize_t uframe_periodic_max_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { From patchwork Fri Jan 20 15:44:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 645408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B24B3C27C7C for ; Fri, 20 Jan 2023 15:44:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbjATPoP (ORCPT ); Fri, 20 Jan 2023 10:44:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbjATPoK (ORCPT ); Fri, 20 Jan 2023 10:44:10 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F635518EC; Fri, 20 Jan 2023 07:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674229449; x=1705765449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KclXtp6RTwwDl0Jov5zoQLZjJ3zoGzOqCU2QiwmBSBo=; b=V5wPBcTaXOVkMHAiT9VCLqhFphYl+k6j7OClKUOxDSl2g3oFw8YnGZqt fMrCxbg+e6YehfejNkyeqdvsI1qrugARDYKh0Jw4kN187uzT7SdFAE8M8 ok8ZesY/jDg+/cKwB48jkQVqkzPEbqQwymnS6mlxgfTagZTzJs3Iv7p+0 +sBxuS830oyDiFQs7hdIEIs7QWOC/OiY6d4qM8+XusxTBYk4Lo2XWOO/E cj8tbkWswb5wPEI/GDpWr76IEXm7J6WuBdRw/5XtqT7XS5sfU8uRiyTMT tZtg1Q6T9TFUKTtPx4bP9Ndf1J/sL6T42yseF8M+m7QbVXVGEEZO42Dqn A==; X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="309179498" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="309179498" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 07:44:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="610512126" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="610512126" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 20 Jan 2023 07:44:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id F301F14A; Fri, 20 Jan 2023 17:44:39 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 2/5] usb: fotg210-hcd: Don't shadow error codes in store() Date: Fri, 20 Jan 2023 17:44:34 +0200 Message-Id: <20230120154437.22025-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> References: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org kstrtox() along with regmap API can return different error codes based on circumstances. Don't shadow them when returning to the caller. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/usb/fotg210/fotg210-hcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index 46752a75c428..5a934f5343a7 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -4702,8 +4702,10 @@ static ssize_t uframe_periodic_max_store(struct device *dev, ssize_t ret; fotg210 = hcd_to_fotg210(bus_to_hcd(dev_get_drvdata(dev))); - if (kstrtouint(buf, 0, &uframe_periodic_max) < 0) - return -EINVAL; + + ret = kstrtouint(buf, 0, &uframe_periodic_max); + if (ret) + return ret; if (uframe_periodic_max < 100 || uframe_periodic_max >= 125) { fotg210_info(fotg210, "rejecting invalid request for uframe_periodic_max=%u\n", From patchwork Fri Jan 20 15:44:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 644972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D239C27C7C for ; Fri, 20 Jan 2023 15:44:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbjATPoK (ORCPT ); Fri, 20 Jan 2023 10:44:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjATPoJ (ORCPT ); Fri, 20 Jan 2023 10:44:09 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0AAA6A30D; Fri, 20 Jan 2023 07:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674229447; x=1705765447; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Zvmz1e8tNVkf9F2k6v9cQ9mCVyAkLICIV32C307I3+A=; b=BbOlueFg5urU2fIRZkhnbjmOgZ8lI8vskiRtkaGnfGQWVfjdDzrG4qXw xgbtZAmLM/hVmnBu/1QZXPRDJ9zh3z0a7H+BvDCWlw2DdbT6l1YUe1u3x dv9uml+lx0dPdQWS9X2p9YF7rsZk4T17Eh6nYyG9SUtt6ZzP0ovK90GON 35HutaZ9blgcLU+9v3IMRomfagNFM5G0S4LGugNPbVgFI4SiiI4MgWCo7 s8OfDAWsFEbYALoJ3vHA/83CbcgubdmG2QtMr9D+wwg9BwBUxPIOIeXHb tveEtqmgXFfIfOubGZEjrRqFuXQ2t2nmelrOz7/06wbkbdjqrubTyTrbB w==; X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="309179502" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="309179502" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 07:44:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="610512127" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="610512127" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 20 Jan 2023 07:44:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 048EA36D; Fri, 20 Jan 2023 17:44:40 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 3/5] usb: fotg210-udc: remove redundant error logging Date: Fri, 20 Jan 2023 17:44:35 +0200 Message-Id: <20230120154437.22025-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> References: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/usb/fotg210/fotg210-udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c index 4334504fccc8..18d254125186 100644 --- a/drivers/usb/fotg210/fotg210-udc.c +++ b/drivers/usb/fotg210/fotg210-udc.c @@ -1169,10 +1169,8 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) int i; irq = platform_get_irq(pdev, 0); - if (irq < 0) { - pr_err("could not get irq\n"); - return -ENODEV; - } + if (irq < 0) + return irq; /* initialize udc */ fotg210 = kzalloc(sizeof(struct fotg210_udc), GFP_KERNEL); From patchwork Fri Jan 20 15:44:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 644971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 861AEC25B4E for ; Fri, 20 Jan 2023 15:44:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbjATPoN (ORCPT ); Fri, 20 Jan 2023 10:44:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjATPoJ (ORCPT ); Fri, 20 Jan 2023 10:44:09 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C49596A329; Fri, 20 Jan 2023 07:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674229448; x=1705765448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RqbRnx0DzcmLHk0wnUNW8548wFkwKC+fI9KpOtosq6c=; b=cYsOsDUjw27nWLQLH4VBWH6bwvvKtz1R6gUnnMCtD8O09Z694vixs/97 SHAO4t5Lz7bVRkLGp6PiyL+3RiAmK4dz2hHxOzMk9oPHqhnOzIZ/ngC55 1bEuBtgvJsCUKJHlZ2rUROQyDIO34Rqpg+ExCeVDKW9Vy8sLxtUD86RLe Y4j30Qu3CqjOUejgEOT0nPsBmmVXIegtazJP9y0672g64hYeVjGGw9mtX T3CD3HgY/6Wsw2irboAHaO6WfwAo6jmp1mOnWsU4a4wtPYMB1srxKDEPp KznMItBFZQbO25kB1Wy9m/o+/olbOs2sBtHGuhku6Skw+adWUgydLzggc Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="390114961" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="390114961" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 07:44:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="989427702" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="989427702" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 20 Jan 2023 07:44:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 134CE38F; Fri, 20 Jan 2023 17:44:40 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 4/5] usb: fotg210: Switch to use dev_err_probe() Date: Fri, 20 Jan 2023 17:44:36 +0200 Message-Id: <20230120154437.22025-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> References: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Switch to use dev_err_probe() to simplify the error paths and unify message template. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/usb/fotg210/fotg210-core.c | 6 ++---- drivers/usb/fotg210/fotg210-hcd.c | 8 +++----- drivers/usb/fotg210/fotg210-udc.c | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-core.c b/drivers/usb/fotg210/fotg210-core.c index c06f8eb3acbd..ce00d9407ce5 100644 --- a/drivers/usb/fotg210/fotg210-core.c +++ b/drivers/usb/fotg210/fotg210-core.c @@ -50,10 +50,8 @@ static int fotg210_gemini_init(struct fotg210 *fotg, struct resource *res, int ret; map = syscon_regmap_lookup_by_phandle(np, "syscon"); - if (IS_ERR(map)) { - dev_err(dev, "no syscon\n"); - return PTR_ERR(map); - } + if (IS_ERR(map)) + return dev_err_probe(dev, PTR_ERR(map), "no syscon\n"); fotg->map = map; wakeup = of_property_read_bool(np, "wakeup-source"); diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index 5a934f5343a7..613d29f04bcb 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -5575,8 +5575,7 @@ int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg) hcd = usb_create_hcd(&fotg210_fotg210_hc_driver, dev, dev_name(dev)); if (!hcd) { - dev_err(dev, "failed to create hcd\n"); - retval = -ENOMEM; + retval = dev_err_probe(dev, -ENOMEM, "failed to create hcd\n"); goto fail_create_hcd; } @@ -5600,7 +5599,7 @@ int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg) retval = usb_add_hcd(hcd, irq, IRQF_SHARED); if (retval) { - dev_err(dev, "failed to add hcd with err %d\n", retval); + dev_err_probe(dev, retval, "failed to add hcd\n"); goto failed_put_hcd; } device_wakeup_enable(hcd->self.controller); @@ -5611,8 +5610,7 @@ int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg) failed_put_hcd: usb_put_hcd(hcd); fail_create_hcd: - dev_err(dev, "init %s fail, %d\n", dev_name(dev), retval); - return retval; + return dev_err_probe(dev, retval, "init %s fail\n", dev_name(dev)); } /* diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c index 18d254125186..5b515f5cb2d7 100644 --- a/drivers/usb/fotg210/fotg210-udc.c +++ b/drivers/usb/fotg210/fotg210-udc.c @@ -1258,7 +1258,7 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) ret = request_irq(irq, fotg210_irq, IRQF_SHARED, udc_name, fotg210); if (ret < 0) { - dev_err(dev, "request_irq error (%d)\n", ret); + dev_err_probe(dev, ret, "request_irq error\n"); goto err_req; } From patchwork Fri Jan 20 15:44:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 645409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4A55C38141 for ; Fri, 20 Jan 2023 15:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbjATPoM (ORCPT ); Fri, 20 Jan 2023 10:44:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbjATPoJ (ORCPT ); Fri, 20 Jan 2023 10:44:09 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F242F6A334; Fri, 20 Jan 2023 07:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674229448; x=1705765448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6Qu9mgbn0uz4KQv860MeQD3YerquUjWp1+UWLUDD7Ng=; b=U984D4Q3e7ck21HEAPhZ1bmUnnP5eDxIG6xd77HOO5N1KNkiCpfXkGdK aeKf58fbjH1Q+KoFRRHahyqVgDk2viEBAW1I3d1WRwmLwPVYhGXnbSveR gkZs/xEi6kNqEjThM5OCVK14NvJilhFgRrASehgqLP//uzCbn7TON+7ty HxDIx0t9zqvSola27JcH0koJAiRZ11Ng6yO7bcW9fVUwa6r0IBYhoSrLP FLhLIrTtvBEqxc78xCzSuCCwOZr7DYQEvWPCVWETGz8UVCFR9qUPnMil7 k7Fq0gQi07T9hF1DmjTI+heXeY2SahEOLhqlG0VN7UC6L2on5x8fwsR97 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="390114963" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="390114963" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 07:44:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10596"; a="989427703" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="989427703" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 20 Jan 2023 07:44:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 18DC1373; Fri, 20 Jan 2023 17:44:40 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 5/5] usb: fotg210: use devm_platform_get_and_ioremap_resource() Date: Fri, 20 Jan 2023 17:44:37 +0200 Message-Id: <20230120154437.22025-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> References: <20230120154437.22025-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/usb/fotg210/fotg210-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-core.c b/drivers/usb/fotg210/fotg210-core.c index ce00d9407ce5..202d80adca2c 100644 --- a/drivers/usb/fotg210/fotg210-core.c +++ b/drivers/usb/fotg210/fotg210-core.c @@ -135,11 +135,7 @@ static int fotg210_probe(struct platform_device *pdev) return -ENOMEM; fotg->dev = dev; - fotg->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!fotg->res) - return -ENODEV; - - fotg->base = devm_ioremap_resource(dev, fotg->res); + fotg->base = devm_platform_get_and_ioremap_resource(pdev, 0, &fotg->res); if (!fotg->base) return -ENOMEM;