From patchwork Tue Feb 9 19:23:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 12078987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73F12C433E9 for ; Tue, 9 Feb 2021 19:40:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4388964E7D for ; Tue, 9 Feb 2021 19:40:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233689AbhBITiO (ORCPT ); Tue, 9 Feb 2021 14:38:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233638AbhBIT0F (ORCPT ); Tue, 9 Feb 2021 14:26:05 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B514C0611C0; Tue, 9 Feb 2021 11:24:01 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id s5so25371035edw.8; Tue, 09 Feb 2021 11:24:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pyReI/BEuC4BzvSRo5mXE3P7CpFBNp0uOKqtRDtZmz0=; b=YJPjb0dS96lYDOexjOydBEkgbTkDbxwnkeUSHVABRARJeOksmXglyDYD2RqyVw3O2E t+EVY/HYTcyuQPEAkxjsWudzToJR098RylZVaKH1Of8kbjRGDnhUfN64E81gKOABvlTN BPs/t2qVYxNAG2t7UXIasMOM9q+jQDV4jJrw72K7hdOKuZAdn7uHWPmj+kh8XogAP30L SHqKpYLguNlitYOH2Ih4GBSHsujJDoOn8KvJ19oO+GMVUp5V2bjf6t8a85fd+zJhhlTp bMNFWbKlGIOe1EmF9QeWKZXkz1AiCvIGuhtWnq35HOS2ukzxBa+E7DK/Dl2kle/gS8gh cVHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pyReI/BEuC4BzvSRo5mXE3P7CpFBNp0uOKqtRDtZmz0=; b=hrjZcO390JwyQnP8IiAhI16GQSyfjKY33nLiuhfAZfwASQruohg81zvgtHRMiP9mOQ 6WsynAGLuG8CX32qbcJdt3Wl1RcU0wHtwybQfAef/5ul8Myt6dJiAvsPWMOrjGqRxEwO Z1a7DZ+fM4AwKjEqlMpwFtWQPaP7jYHKtZh8hVPh7jVifhos3mykzPYI9vZkRnpnnszi e3cHZ3T0EKITOjjAOPyQ7A+99Ibto59Fty9MqGFPN5SqokQI41Q5tFqnw5moyN7MP+y1 gBf7j74jMCqUfuFwyMD0CD62QeC5R/dqIlcnv/ZgUgTM7Gk1qU2Qi7TkOOC8NNgl5FIG IPxw== X-Gm-Message-State: AOAM533fqwsCLhCT9TaefCZxpqc7S4aRl/WZQLZb4F7KQTVHQ9c5GvF5 xu85LtEDO5HvbnaAPEfXMtvX7bq3scw= X-Google-Smtp-Source: ABdhPJz+bOuBJ3/9q6WA9aKGxDaFG4ToV8V9ky4ts+krOYiuFJikzdaJMlOuwtuQTxx8Th0zBx7T9A== X-Received: by 2002:a05:6402:104b:: with SMTP id e11mr22202102edu.367.1612898639910; Tue, 09 Feb 2021 11:23:59 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id w3sm11075779eja.52.2021.02.09.11.23.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 11:23:59 -0800 (PST) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, balbi@kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/8] usb: dwc3: of-simple: bail probe if no dwc3 child node Date: Tue, 9 Feb 2021 20:23:44 +0100 Message-Id: <20210209192350.7130-2-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210209192350.7130-1-jbx6244@gmail.com> References: <20210209192350.7130-1-jbx6244@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org For some of the dwc3-of-simple compatible SoCs we don't want to bind this driver to a dwc3 node, but bind that node to the 'snps,dwc3' driver instead. The kernel has no logic to decide which driver to bind to if there are 2 matching drivers, so bail probe if no dwc3 child node. Signed-off-by: Johan Jonker --- drivers/usb/dwc3/dwc3-of-simple.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index e62ecd22b..347b4d384 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -38,6 +38,10 @@ static int dwc3_of_simple_probe(struct platform_device *pdev) int ret; + /* Bail probe if no dwc3 child node. */ + if (!of_get_compatible_child(dev->of_node, "snps,dwc3")) + return -ENODEV; + simple = devm_kzalloc(dev, sizeof(*simple), GFP_KERNEL); if (!simple) return -ENOMEM;