From patchwork Thu Oct 10 14:17:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 282271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A85AA2C011C for ; Fri, 11 Oct 2013 01:19:03 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752327Ab3JJOSo (ORCPT ); Thu, 10 Oct 2013 10:18:44 -0400 Received: from mga02.intel.com ([134.134.136.20]:46802 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753997Ab3JJOSo (ORCPT ); Thu, 10 Oct 2013 10:18:44 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 10 Oct 2013 07:18:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,1072,1371106800"; d="scan'208";a="417242914" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.159]) by orsmga002.jf.intel.com with ESMTP; 10 Oct 2013 07:18:39 -0700 From: Jarkko Nikula To: linux-i2c@vger.kernel.org Cc: linux-acpi@vger.kernel.org, Wolfram Sang , Jarkko Nikula , Mika Westerberg Subject: [PATCH] i2c: Fix modalias for ACPI enumerated I2C devices Date: Thu, 10 Oct 2013 17:17:49 +0300 Message-Id: <1381414669-26115-1-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 1.8.4.rc3 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org There is a minor fault about ACPI enumerated I2C devices with their modalias attribute. Now modalias is set by device instance not by hardware ID. For example "i2c:INTABCD:00", "i2c:INTABCD:01" etc. This means each device instance gets different modalias which does match with generated modules.alias. Currently this is not problem as matching can happen also with "acpi:INTABCD" modalias. Fix this by using ACPI hardware ID. Signed-off-by: Jarkko Nikula Cc: Mika Westerberg --- Generated on top of v3.12-rc4-29-g0e7a3ed. --- drivers/i2c/i2c-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 29d3f04..6dd0c53 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1111,7 +1111,7 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level, if (ret < 0 || !info.addr) return AE_OK; - strlcpy(info.type, dev_name(&adev->dev), sizeof(info.type)); + strlcpy(info.type, acpi_device_hid(adev), sizeof(info.type)); if (!i2c_new_device(adapter, &info)) { dev_err(&adapter->dev, "failed to add I2C device %s from ACPI\n",