Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp368987pxb; Thu, 12 Nov 2020 06:03:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPjMFHCNkffdt83yI6n5W2dPhzb5zBVyhmlz6oWlMDvh6/ghBTPO71clTx8rAMKmgDe48i X-Received: by 2002:a17:906:1f86:: with SMTP id t6mr29703620ejr.356.1605189793325; Thu, 12 Nov 2020 06:03:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605189793; cv=none; d=google.com; s=arc-20160816; b=rbB79aLHszLAc16aALTA3pWcRE/ABcwAhBnUG4B9Ib+JlLcCffG91iQaELZF4YTEgh ob3H+lW+fCthSDrgzXdQ2cpNaZj3oO0w8SEZj+hwzoHX4Y+KLzqoVsvrnTaM3hnZr4mV 51x18Tu3mL+8bxdmHOuKrl0Gh9XOi2xCx3LhS7jaY5WyBpK/Q0I/DDiIZzCg+KhPBImM kvWGVnPyRE/oXCAibg4yzEnYM5Xl2ywQF9Bevr3vBT27Ks6ob7wKqSL1vUy13sOJhg9a NEX0wF1qmUj40drHyYaAec7mo3likJK37aT38kyBAFx5Dt9qgfy6Ryadu3p4FYDaBESB AKVg== 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:cc:to:from; bh=rnp6Rfy4GHdD9qq59/5Cd7hmOu5ELRGl4a+J5bDZIUo=; b=Kck8Y2UpBtCME1X2SBzwXMbvnPMZCtbQe8GU4PB7wYOqaZV66U/OuM2b+COHKQfEii z7pLwXCXtGDUYcz/BTzl59XCIz4FHQAD6JIQ6ylFiT2khvxeiNW+HwjTSpUYucqZX9BZ arqWeL823tgMtFPvvF/s7KGIkzJ//8rQlj4Uo69qIHQEnUhn6Ug4YXznwtP3DEcpEn8m B0NBLIzWoc8QBWS9rybBjGuzEBAurdB8cAaVH/FQL5DbShN+FGymbl7SvAvtQNbN5F35 baVXflqPhOUsArN3yJgNeyNmw4Qi8XwmPVYqZJcbDsNP/1uKTvZXTXjTsNltZkj0xASz JUxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si3950517edr.244.2020.11.12.06.02.48; Thu, 12 Nov 2020 06:03:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbgKLN7O (ORCPT + 99 others); Thu, 12 Nov 2020 08:59:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbgKLN7O (ORCPT ); Thu, 12 Nov 2020 08:59:14 -0500 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F8FC0613D1 for ; Thu, 12 Nov 2020 05:59:13 -0800 (PST) Received: from ramsan.of.borg ([84.195.186.194]) by andre.telenet-ops.be with bizsmtp id rRz9230044C55Sk01Rz9M2; Thu, 12 Nov 2020 14:59:09 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kdD80-001rT1-LT; Thu, 12 Nov 2020 14:59:08 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1kdD80-00G2Ra-4E; Thu, 12 Nov 2020 14:59:08 +0100 From: Geert Uytterhoeven To: Chunfeng Yun , Bin Liu , Greg Kroah-Hartman Cc: Drew Fustini , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] Revert "usb: musb: convert to devm_platform_ioremap_resource_byname" Date: Thu, 12 Nov 2020 14:59:00 +0100 Message-Id: <20201112135900.3822599-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 2d30e408a2a6b3443d3232593e3d472584a3e9f8. On Beaglebone Black, where each interface has 2 children: musb-dsps 47401c00.usb: can't request region for resource [mem 0x47401800-0x474019ff] musb-hdrc musb-hdrc.1: musb_init_controller failed with status -16 musb-hdrc: probe of musb-hdrc.1 failed with error -16 musb-dsps 47401400.usb: can't request region for resource [mem 0x47401000-0x474011ff] musb-hdrc musb-hdrc.0: musb_init_controller failed with status -16 musb-hdrc: probe of musb-hdrc.0 failed with error -16 Before, devm_ioremap_resource() was called on "dev" ("musb-hdrc.0" or "musb-hdrc.1"), after it is called on "&pdev->dev" ("47401400.usb" or "47401c00.usb"), leading to a duplicate region request, which fails. Signed-off-by: Geert Uytterhoeven --- drivers/usb/musb/musb_dsps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 30085b2be7b90bf1..5892f3ce0cdc824d 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -429,10 +429,12 @@ static int dsps_musb_init(struct musb *musb) struct platform_device *parent = to_platform_device(dev->parent); const struct dsps_musb_wrapper *wrp = glue->wrp; void __iomem *reg_base; + struct resource *r; u32 rev, val; int ret; - reg_base = devm_platform_ioremap_resource_byname(parent, "control"); + r = platform_get_resource_byname(parent, IORESOURCE_MEM, "control"); + reg_base = devm_ioremap_resource(dev, r); if (IS_ERR(reg_base)) return PTR_ERR(reg_base); musb->ctrl_base = reg_base; -- 2.25.1