From patchwork Thu Apr 13 23:32:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9680431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE75660326 for ; Thu, 13 Apr 2017 23:32:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5C7F2768C for ; Thu, 13 Apr 2017 23:32:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7BD827FE4; Thu, 13 Apr 2017 23:32:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A1F82768C for ; Thu, 13 Apr 2017 23:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbdDMXc3 (ORCPT ); Thu, 13 Apr 2017 19:32:29 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35155 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752365AbdDMXc2 (ORCPT ); Thu, 13 Apr 2017 19:32:28 -0400 Received: by mail-pg0-f68.google.com with SMTP id g2so14023830pge.2; Thu, 13 Apr 2017 16:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=QjUfRHwSMysnXUwp5CihtGh+CaE5Lkr/tcJxwbcUa1Y=; b=joJiv/oGL5FM8pGrQPIqYReKbbmJj/+PeOrI5CsGd71D/LuDzNiQMg3NyEdvsqgcp3 jCwmymrpsD7uuCgZVqCX9WU0RbsvG9mNhHfClbcrnpwKeZ8GwpO7y26wyzVNR4LQuX7O T5Ktf8Wj1dEnaTknnXmbNd8thcMp4ngWk3mgBOlzQ7U2kAf5gpOd54MTWmWvzHKXMiYv FATziZU/lb8z7rTX8fj0sJ+MetAvlbQAmlDfFvQwFgOGmb4CMuEuKLoGgMv1/PURQN/H XdAk5NYTmgb/r2GBZPq5fg5XQnX/uMADNdH42/5BQELPeps3BGYio6/hFdw40/ZTN0yt hbdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=QjUfRHwSMysnXUwp5CihtGh+CaE5Lkr/tcJxwbcUa1Y=; b=dvQdneph4yOZznw2uq7g6wia06h8WQF+iCTmiMVYlAbp29yFJxT0pkuo1YI5PIHX5k 2mHMrb8/4j+/iZRYuzglxoViDzQK0flkdFDhPBCyo58dxW8nRljwN4HscpN/RdFg5ekR fDQaoTLrT5ZKP+lz/xxLel81s8z9DEWzTYlxjJiXjQL/NScLL8wTJOvf+sdbMtfpmtfq wO+u8A5gUNLwyOSYfKHWDl4zjHL6faT64qdRiyQ66MrnzeOXwjeUPNleTTwYHo6rgz2C dhfYGuibJtjE+tHqrsytajphMjdPRtm3+OWha3sD42f3Ic2a4hKDVF7KtIjC8v4c8JIe 6Qaw== X-Gm-Message-State: AN3rC/4u3vZUazDuaqqncwnfXWI5QqlO3w5FErMFcvaTroNcADC6lNJa 4ZKX922fAPELbA== X-Received: by 10.84.230.230 with SMTP id e93mr5637739plk.187.1492126347803; Thu, 13 Apr 2017 16:32:27 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1311:91dd:3e36:1236:8882]) by smtp.gmail.com with ESMTPSA id z123sm170666pfz.56.2017.04.13.16.32.26 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 13 Apr 2017 16:32:27 -0700 (PDT) Date: Thu, 13 Apr 2017 16:32:25 -0700 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Wolfram Sang , Jean Delvare , m.frohiky@gmail.com, Christian Gmeiner , linux-kernel@vger.kernel.org Subject: [PATCH v2] Input: ar1021-i2c - fix too long name in driver's device table Message-ID: <20170413233225.GA30465@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The name field in structure i2c_device_id is 20 characters, and we expect it to be NULL-terminated, however we are trying to stuff it with 21 bytes and thus NULL-terminator is lost. This causes issues when one creates device with name "MICROCHIP_AR1021_I2C" as i2c core cuts off the last "C", and automatic module loading by alias does not work as result. The -I2C suffix in the device name is superfluous, we know what bus we are dealing with, so let's drop it. Also, no other driver uses capitals, and the manufacturer name is normally not included, except in very rare cases of incompatible name collisions. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=116211 Fixes: dd4cae8bf166 ("Input: Add Microchip AR1021 i2c touchscreen") Signed-off-by: Dmitry Torokhov Reviewed-By: Christian Gmeiner Tested-by: Martin Kepplinger Reviewed-by: Jean Delvare --- V2: Changed MICROCHIP_AR1021 -> ar1021 as Jean suggested. drivers/input/touchscreen/ar1021_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c index 2e7500edd477..6797e123925a 100644 --- a/drivers/input/touchscreen/ar1021_i2c.c +++ b/drivers/input/touchscreen/ar1021_i2c.c @@ -151,7 +151,7 @@ static int __maybe_unused ar1021_i2c_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, ar1021_i2c_suspend, ar1021_i2c_resume); static const struct i2c_device_id ar1021_i2c_id[] = { - { "MICROCHIP_AR1021_I2C", 0 }, + { "ar1021", 0 }, { }, }; MODULE_DEVICE_TABLE(i2c, ar1021_i2c_id);