Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp68036pxb; Mon, 13 Sep 2021 13:08:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7vMNTcnNLv9BrqrCHspmvUDxzIv3vi0cnrMfqIl2KzdlgUck3c4kAxKAYgzsOgsdRFdwQ X-Received: by 2002:a17:906:2655:: with SMTP id i21mr8796414ejc.15.1631563729763; Mon, 13 Sep 2021 13:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563729; cv=none; d=google.com; s=arc-20160816; b=sGoVGOqfhPxT+33JCjfH3bQS0Hwb3rKhYjXx37oi3el7QQ621JuHTZxfSWe214lDGL 41u5Df0rivGj1j+w05lFYvF7IvXWITwT3WDp29NUd1hrKbidV0IyGz6eaGDWBQojBGVU EKBrBn32DtLCd1XkdDm94YVgXdeLCmG/bkESLQauNaP5yBWZonTCSY0CNGEAnqKodejc UUFw+jQTThznxrg3/jme+soVg0maVJItbx8005dDEsyXOScpY13mVX7+5Eg+7s9tC+Ng 95ZwDcpOsiGOF7hsZuckyWqKzNt2xzbMaoDKiQTyQlt3v7I3GsFaaOyuTDe0Wf/x+q2t yT2w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fPyGrHSVq1o05B9ClnHLwM0cSl4qpQB1iKLz57IlD5A=; b=LcDeEllQWvK8DBnERq2x+TZZxOuBxbQqzBEVUK/QfKMKqYcEW5H77DCt+ULnO2EnTb LT4GDlT72NOixIAeNCs0TD8a5/EkITp4kFXZSlqDFtbzct2Y89g7w6DjYQ+krNu56ooi faE5Zb060NfG3do8WcGiegddSSUpTTmP8sGpAieSiCrAwvIYrHIlXQjqV9gDCUvblLt1 GAI7bcujc0xbf2wrwBACo/v8O2Z42sSry6Aa5iu2LtgBV7VROR7s+lIrBhe1WuEMNXmH ID17NwSn13DWK96uiHQx6JOEmTOPM8hcvZvnDekK6FJQX0n6h9fNlLKXsmXatfxH8KkM 6f9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kjv32Q+M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si7922027edb.223.2021.09.13.13.08.26; Mon, 13 Sep 2021 13:08:49 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kjv32Q+M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242579AbhIMNqO (ORCPT + 99 others); Mon, 13 Sep 2021 09:46:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:41184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241315AbhIMNkp (ORCPT ); Mon, 13 Sep 2021 09:40:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 675BC61406; Mon, 13 Sep 2021 13:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539768; bh=CTiolkTYws3gyQMM4I7/ByBwnzaC+QtGEsiS/SDkDMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kjv32Q+M4H48TNGBHlFHy192doeUfYolFk2ZEXwlAww7CanP25BHv9ZQ62jD+V0Bz 19r8yr1CXe1QWqa6E7Y/nfmXvqhgACzU2LbfKBqiCiTEdPG2ZqGjNNn5hb+k7dcB4L kRgEAT3bNlu+4IQXMnGFGNydxiz37KbJjbuEoAis= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.10 153/236] usb: gadget: udc: renesas_usb3: Fix soc_device_match() abuse Date: Mon, 13 Sep 2021 15:14:18 +0200 Message-Id: <20210913131105.578390569@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven [ Upstream commit cea45a3bd2dd4d9c35581328f571afd32b3c9f48 ] soc_device_match() is intended as a last resort, to handle e.g. quirks that cannot be handled by matching based on a compatible value. As the device nodes for the Renesas USB 3.0 Peripheral Controller on R-Car E3 and RZ/G2E do have SoC-specific compatible values, the latter can and should be used to match against these devices. This also fixes support for the USB 3.0 Peripheral Controller on the R-Car E3e (R8A779M6) SoC, which is a different grading of the R-Car E3 (R8A77990) SoC, using the same SoC-specific compatible value. Fixes: 30025efa8b5e75f5 ("usb: gadget: udc: renesas_usb3: add support for r8a77990") Fixes: 546970fdab1da5fe ("usb: gadget: udc: renesas_usb3: add support for r8a774c0") Reviewed-by: Niklas Söderlund Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/760981fb4cd110d7cbfc9dcffa365e7c8b25c6e5.1628696960.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/renesas_usb3.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index f1b35a39d1ba..57d417a7c3e0 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2707,10 +2707,15 @@ static const struct renesas_usb3_priv renesas_usb3_priv_r8a77990 = { static const struct of_device_id usb3_of_match[] = { { + .compatible = "renesas,r8a774c0-usb3-peri", + .data = &renesas_usb3_priv_r8a77990, + }, { .compatible = "renesas,r8a7795-usb3-peri", .data = &renesas_usb3_priv_gen3, - }, - { + }, { + .compatible = "renesas,r8a77990-usb3-peri", + .data = &renesas_usb3_priv_r8a77990, + }, { .compatible = "renesas,rcar-gen3-usb3-peri", .data = &renesas_usb3_priv_gen3, }, @@ -2719,18 +2724,10 @@ static const struct of_device_id usb3_of_match[] = { MODULE_DEVICE_TABLE(of, usb3_of_match); static const struct soc_device_attribute renesas_usb3_quirks_match[] = { - { - .soc_id = "r8a774c0", - .data = &renesas_usb3_priv_r8a77990, - }, { .soc_id = "r8a7795", .revision = "ES1.*", .data = &renesas_usb3_priv_r8a7795_es1, }, - { - .soc_id = "r8a77990", - .data = &renesas_usb3_priv_r8a77990, - }, { /* sentinel */ }, }; -- 2.30.2