Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5850964ybn; Sun, 29 Sep 2019 07:04:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqtU0Z9zcOAxIZTLJWY6y6Kpan87D2PsHYZhnvffmGab+MPhCWn9gEorgRSRnX0b2WNiwh X-Received: by 2002:a50:ee10:: with SMTP id g16mr14659892eds.267.1569765876680; Sun, 29 Sep 2019 07:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569765876; cv=none; d=google.com; s=arc-20160816; b=s5DRy7l8s3xCUZ0Ln+ksIC4jdyqWfcDVSaUlEoplWOnWWOllG7AhlWX8m2EdFCpBnp QSepm3OEqecEj4l9GDl2srBnLLaK8fucWVNwJuJZ5u23oTfXLahPMLCKssVB1Qc7fZVv jPT28XDkVMOvyezJm6su4GNuB/O+lITnETVmyud3X+iNVptU11rS24J7z1HuVNTZUN0N DjXdtLArxVh8c/q/Z5Hw7ltwAnDO4BNlfHXc4AVvuI/aEM7OHdcOYO+nEyRRlDnf+485 rFDqFKejYIAyfGwEKQvRIBa+ca7Tyi5oGMRphtlE8zjXmXEZrTiF0xC7iPu5yzZRxYCQ XBhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ggxQaP3T6sMDis/9UlwMXpgZbT8sMO7xLw/VexXvmbU=; b=Ra5YdR+BjBrrml8cOFm3o8jtvXeDSTcoEmjQ4jXTShCHz6ttEq8mXxSjZLAjlwzaAl RppsL27r5gvDhBtB8lZbfPkBrLN58RG1yPNem0LlWxyuK1Zi5bNbgEK7lSH9uTCSvX9k WN3SX878zsCP94zImcl0rhpOYnppOuzFLpo1x/MBjrOZAz+kYuXxIWN5e+aT3obU+mfo E46rhg7kV6YRbj49hTPp7Qn/RACVI9tXHM6OTPME0jGpiEdpHfREZKWm77Lg6RutJG9E 4taCc659LdDXiiD4/Sx3jEm4cL4lB2G/bSB7Ir/sRA3c0O201x51yqa3OaBFVT4RrckF QGQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wT0AxZ0n; 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 p2si5052390edx.106.2019.09.29.07.04.10; Sun, 29 Sep 2019 07:04:36 -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; dkim=pass header.i=@kernel.org header.s=default header.b=wT0AxZ0n; 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 S1730025AbfI2OBX (ORCPT + 99 others); Sun, 29 Sep 2019 10:01:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729338AbfI2OBV (ORCPT ); Sun, 29 Sep 2019 10:01:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B8E4C21835; Sun, 29 Sep 2019 14:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765680; bh=ycVtQSzkyz8L8hAEyRtDzR1Rj+c+zpn/rD+u8cVqfuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wT0AxZ0nvIZGbst6lyGAVDqviNONXZ4/1NDTgEnPBE7dW+WP0TpaAsGZlgit01Q+y rwMKB8mqmqkS1p0eHBhLubjujRifJ6G28224UnmZqQX2HoOiacOxcoRBju3zazFoLE dfhlQe/3ATaxJPLyO4C4qDfMfZ/ouD/bMJxWpzVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus , Hans de Goede , Andy Shevchenko Subject: [PATCH 5.2 28/45] platform/x86: i2c-multi-instantiate: Derive the device name from parent Date: Sun, 29 Sep 2019 15:55:56 +0200 Message-Id: <20190929135031.710953515@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135024.387033930@linuxfoundation.org> References: <20190929135024.387033930@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heikki Krogerus commit 24a8d78a9affb63e5ced313ccde6888fe96edc6e upstream. When naming the new devices, instead of using the ACPI ID in the name as base, using the parent device's name. That makes it possible to support multiple multi-instance i2c devices of the same type in the same system. This fixes an issue seen on some Intel Kaby Lake based boards: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-INT3515-tps6598x.0' Fixes: 2336dfadfb1e ("platform/x86: i2c-multi-instantiate: Allow to have same slaves") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/i2c-multi-instantiate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/platform/x86/i2c-multi-instantiate.c +++ b/drivers/platform/x86/i2c-multi-instantiate.c @@ -92,7 +92,7 @@ static int i2c_multi_inst_probe(struct p for (i = 0; i < multi->num_clients && inst_data[i].type; i++) { memset(&board_info, 0, sizeof(board_info)); strlcpy(board_info.type, inst_data[i].type, I2C_NAME_SIZE); - snprintf(name, sizeof(name), "%s-%s.%d", match->id, + snprintf(name, sizeof(name), "%s-%s.%d", dev_name(dev), inst_data[i].type, i); board_info.dev_name = name; switch (inst_data[i].flags & IRQ_RESOURCE_TYPE) {