Received: by 10.213.65.68 with SMTP id h4csp1770701imn; Mon, 19 Mar 2018 12:48:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELtZwgysBOGQq1pAym2rlohv6uDvBjn6opQ6Qo+O4RYOmNkSSv3JgTSl3wl6nQQX9CiFZdvZ X-Received: by 10.98.72.205 with SMTP id q74mr10730146pfi.70.1521488914320; Mon, 19 Mar 2018 12:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521488914; cv=none; d=google.com; s=arc-20160816; b=gIa0ShTiv1pYG4+UoWYZp5sqwr3pmllwqQAyZC/zX/oIr9Y68+E8cy0f4Bjqux3dTt JA4mflWgudDx5CM43EQNqKzFdVvRUSbIQvkhJTltKQZraAb30/a5HOOomCluakOrksiI KO80BI2sYEIzv1yfc6/2wpCJOk9kQcOsGeIYlQnQykFclX8YtoamgfdAr7APVrXYSw8A oh1rqEem8OtbES2M0+ZM77e3drj59mtMirrcDPeFUZg9+pTndC4JyxsJQ7JVxOhwVAWS wjXW4VkA/uyzgHEuILHKYVsxRdN42sRJW9WrxpGsaHAAGXwi3qWoHLjbX5rSlH8kxWTG eTcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0h2wQ+zyfTG2mG+OGdA4Ck6acRNfATfO+3U8bqUA8SM=; b=uyzsEydHx2t6aXvDVYPGKMojgC87v9bx/nNxJROpdqeyouWJWFxvIdqxw7AHQfCRwu iHeVkApvJSyTSfXlkVSJnLwjx35/doGeiUbOwS3PZY7toPFHMuQYdNWY0l/2LhoEMQ0J T0TbE3jyHbIYWpe3304IL09EJqc0OpR6OtBQVrQSLrrWTBf2Gbb/CeNAgJYp/Fe4FnB2 A2cVnl0bY78PS/sR+DOItnY5fF81NHSsp3biQu584228GktoC25gi9CLamAuiDWHGdCw 34Pp9cuNMrSyT/SU1Mig1Y8jH3vc43ZhAmTqppTzc7R9T+erRV5JPT4oqsD2fjqU0qj0 uIsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si225316pgp.285.2018.03.19.12.48.18; Mon, 19 Mar 2018 12:48:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969912AbeCSTqb (ORCPT + 99 others); Mon, 19 Mar 2018 15:46:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47716 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031002AbeCSSUc (ORCPT ); Mon, 19 Mar 2018 14:20:32 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 493921136; Mon, 19 Mar 2018 18:20:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Javier Martinez Canillas , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.9 058/241] Input: qt1070 - add OF device ID table Date: Mon, 19 Mar 2018 19:05:23 +0100 Message-Id: <20180319180753.606780668@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Javier Martinez Canillas [ Upstream commit cf5cd9d4480a87da78768718cac194a71079b5cb ] The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. The compatible strings don't have a vendor prefix because that's how it's used currently, and changing this will be a Device Tree ABI break. Signed-off-by: Javier Martinez Canillas Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/keyboard/qt1070.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c @@ -274,9 +274,18 @@ static const struct i2c_device_id qt1070 }; MODULE_DEVICE_TABLE(i2c, qt1070_id); +#ifdef CONFIG_OF +static const struct of_device_id qt1070_of_match[] = { + { .compatible = "qt1070", }, + { }, +}; +MODULE_DEVICE_TABLE(of, qt1070_of_match); +#endif + static struct i2c_driver qt1070_driver = { .driver = { .name = "qt1070", + .of_match_table = of_match_ptr(qt1070_of_match), .pm = &qt1070_pm_ops, }, .id_table = qt1070_id,