Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1395067rwb; Thu, 15 Dec 2022 09:34:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7yARVPPIyGQzh/uD/mvm9wQRIPQOIb8SF/3Mdn2WeNjDM31r3yTUBWVnGE8tTTOemlh1W+ X-Received: by 2002:a17:902:6b08:b0:186:644f:bef1 with SMTP id o8-20020a1709026b0800b00186644fbef1mr29450185plk.6.1671125657510; Thu, 15 Dec 2022 09:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671125657; cv=none; d=google.com; s=arc-20160816; b=ecFiBfCa9n3dH1/Z+qaOODE9j4bi54IAiSkdLU9vmr5a+NqjCidwOEzIs2qcm9Vjum G7FWZRWuJWblO96wy1bA5gyuKp0dZH6REJfBCx60IumpKmtriHh9FL1YC1MoeD4GePRd 2DQlq8TJk3lhskShu71fFIpD2QIMc2jWQKCEL4j/vk9NewC8gG/RahEbpxUFnXP3vzzf YGVNzwlKUdiuuPP1IXVcuasVyx5XYs7BoYGDE92r4si9XyljRaWeoJzoN9/rg3Cu3tMX Z+fOD2gPvzalQMQz3dYIMxzZKHAJ8sucLVESeT17TvfU7hhb7lQHV6hBwESqYjzmrLiB JCHA== 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:dkim-signature; bh=6m6ImrmpwFtrSDM4/OWrSVgk0ETrjzYVeEuXkPAI1D4=; b=AFWUOuHBMAMAD15dvLrIU1EVaXBY8cvBFNb99QMbJ9Rz5NzLthGDkPfM/W79mjSj6R 5Z+QelhGOu0QTDCEmfH0CbQGq0wLnxb1HxSh9/f/ddMFVEUV5wzd8xBKLMs3DCGeneQb 8MrQ7NcuRsO836iRWSl1FjeExb2rvQolWHwKbqANj4Ond/+BZvrVf3NbIhShBZjlbreZ CUpyHGw3AkDeiIvpBEfggqKLflHklbK56XEHWggqNkJuSOFyTDezC1XNhVNMrPSaJSD6 QmPAz0TGRxj3jIpf5atmXdR2hwvL5CubHJogPSVdEDvcvXXSegJ3F8+qoUYJYaZDyulj PofQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=givVkMtF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t16-20020a170902e85000b0018659ff71d2si6896923plg.62.2022.12.15.09.34.08; Thu, 15 Dec 2022 09:34:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=givVkMtF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbiLOQ55 (ORCPT + 69 others); Thu, 15 Dec 2022 11:57:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiLOQ5f (ORCPT ); Thu, 15 Dec 2022 11:57:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CCB1F2DA; Thu, 15 Dec 2022 08:57:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 750B7B81BA1; Thu, 15 Dec 2022 16:57:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F04BEC433D2; Thu, 15 Dec 2022 16:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671123452; bh=oxPz7HtXrfByGYf3eU7B6+A8T/7fxcrvKYYneerUSm4=; h=From:To:Cc:Subject:Date:From; b=givVkMtFWaotvmJ1+XDJbSdN2Na3UB6kWl4YGwo8W6P71kfN/7Ea8/LI8qyhouhMp diMEiY+Z0QzZdDcMgz1eyM/A6y3hbTxmiI3CHqr+aTpeuZ0fKIqAy3mfYr9LMFGjJA 8AXyX97+eKRCCJlIqXv7XBu4AHz+oK1oL64lQ/rmEjr9SXjxPVFoF0IUt8S9PB3gc5 8rT1oo0pvJ7fZf5qeKtp296FnPq6XMINzi4THJkiO008w/KB40nBRaLXBR+fwtWug9 L2wFt7duf9lvdAfk3XJqX2KcHh9SawDeGTLiCT8tpV5m3jfGXQgQnKPvm1/kfkS/hj I4aSs8GaOxQ4g== From: Arnd Bergmann To: Linus Walleij Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: fotg210: fix OTG-only build Date: Thu, 15 Dec 2022 17:57:20 +0100 Message-Id: <20221215165728.2062984-1-arnd@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The fotg210 module combines the HCD and OTG drivers, which then fails to build when only the USB gadget support is enabled in the kernel but host support is not: aarch64-linux-ld: drivers/usb/fotg210/fotg210-core.o: in function `fotg210_init': fotg210-core.c:(.init.text+0xc): undefined reference to `usb_disabled' Move the check for usb_disabled() after the check for the HCD module, and let the OTG driver still be probed in this configuration. A nicer approach might be to have the common portion built as a library module, with the two platform other files registering their own platform_driver instances separately. Fixes: ddacd6ef44ca ("usb: fotg210: Fix Kconfig for USB host modules") Signed-off-by: Arnd Bergmann --- drivers/usb/fotg210/fotg210-core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-core.c b/drivers/usb/fotg210/fotg210-core.c index 8a54edf921ac..ee740a6da463 100644 --- a/drivers/usb/fotg210/fotg210-core.c +++ b/drivers/usb/fotg210/fotg210-core.c @@ -144,10 +144,7 @@ static struct platform_driver fotg210_driver = { static int __init fotg210_init(void) { - if (usb_disabled()) - return -ENODEV; - - if (IS_ENABLED(CONFIG_USB_FOTG210_HCD)) + if (IS_ENABLED(CONFIG_USB_FOTG210_HCD) && !usb_disabled()) fotg210_hcd_init(); return platform_driver_register(&fotg210_driver); } -- 2.35.1