Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp735145pxu; Wed, 2 Dec 2020 01:51:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgJPOg1zTZXsYmOSvuzeFLEeYD59GFnDSiXYeosPIPUhihQHXvjzeDNHlB9haQGT9vLozc X-Received: by 2002:aa7:d514:: with SMTP id y20mr1727007edq.384.1606902692364; Wed, 02 Dec 2020 01:51:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606902692; cv=none; d=google.com; s=arc-20160816; b=THvqAsow4gWjVvYXnbVqbz7cw6yMlbsSqJyWokOozum0t0e48gweFMSgScL3vKVMLF 9qIHVyevNPAqsgfMluTVfjOJoniy1wXAPmMLEBtaLjuihwUh58gUZBK/ONLMhK+FJ7Fc u74dDb9hBvp7ENgOvlYKRrwzDe3G7HJ2cF1WEaRiwcDPfdx+UJH8kKLNjbYRcQWtqYzn Opd5HpwM+UX2baHG8ElUVOzuZLJVjrjuS1ITHP3WHWrvk7Q2vV7exy/ZtBgKp0X9K7Je ET6Ly4dgFuU2DnFujMx2jZIl74HBOe0SA+kUPmkc9Wi+t9qRJWOMfaOxhDG9bMGxexmA YQMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=yQcKfKpaPCijy5k5bBL/2/rvkWxF60Sjyf/OFciVT4E=; b=RS81WpjKRBBrR58KWmvUpdc4upohtHaK4LV3hYcn0bwfNl4Mvopyj59Au0lG7Ku+vI HPO9E0GvcrVAUwS0JP6AEtJ3pBsbXMXkDsMO05OGQAtAlMscx2joQYVjVe2MiE/pfEht TfKLULRxxCTUODh5qh66SbZ/XEAz8dqg5pz/TTFkr45plHCGWC5d1OpaA321q3wfksrf OHP+frz8eN8TUJa/R1Hs+Ln9b0Klxua+q5jEGRlns7YltvqbxnRVczSya1W7zdeQsAgD NRc/vr6FOFjBt9HhxMn6r/7LkqZj66piMwFXUW7ihWZv4LLEvpPrqveIYuJlxlROnyRP TE4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NS2dkcDR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si720854edr.89.2020.12.02.01.51.08; Wed, 02 Dec 2020 01:51:32 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=NS2dkcDR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388437AbgLBJtt (ORCPT + 99 others); Wed, 2 Dec 2020 04:49:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgLBJts (ORCPT ); Wed, 2 Dec 2020 04:49:48 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2D36C0613CF; Wed, 2 Dec 2020 01:49:07 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id p8so2870496wrx.5; Wed, 02 Dec 2020 01:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=yQcKfKpaPCijy5k5bBL/2/rvkWxF60Sjyf/OFciVT4E=; b=NS2dkcDRwlstmZMjKx+25hsYmoZXzToqWqP5Brh93+gnrg1sJPJPLygKQEMv3aMs0S 4wPWuwzjvOvhI7MSAyK2A47UZSTNLBT47aahoQJBlUCMTW4bjFg90pxWhNmFgPPrXOXv TNufwpUbncla2U5K5u9Id5ZXfbO2hKi4qvdnOx1X9oWxSy4m3eHqjsWc2H6HVHDEY8Bq Emqg4YqoXJ5ok/2sCOok6Kei5EG0zm2jtq4jmGVgI2EC89t2OKwDZJfzGeOsrRhbadDy 6s+qcY99lWI7XkJF1Obm8kubL1RGRkEvHau3Jje+0NPHuNP0vfky4zq7jwwUGIqHihOX 4Idw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=yQcKfKpaPCijy5k5bBL/2/rvkWxF60Sjyf/OFciVT4E=; b=E/g85nR71vmfhkkIFvICfS4VM9Queav2MkBtQHRCENgKo5O+Ii5OL9P4wtTNRZWnAe dOuUAAaeZxnNg4WgmX8r3AbWwgWFIGIkZHqEmO+R3BvidL0WzMO4587Mq9Ud0aDFF6pw oDxtNkGXF1j3b0TOWncFFwA6xhk66vdT3VOFEXXVMgfWuX/1HrWSNK/eiHHp6L+LyHjX syITO7ykRbnRhHEJd9X9dGZDqcEfz0ItAu9pjUXn7xT7XKTDYOR7MjlzmwMc04JxzXqZ fLwyvD3HScMbS3HS/MLllOMpK+QsBRqx3BHza+Lv01tWaqpB2QG3h6BhFMHZtm0qtYO1 vbhA== X-Gm-Message-State: AOAM530gLCDYbX9WKctE38OF9RvCXsnOrPSuQXuovLHmuSjmfW5hdzvt 2NVdBKy9dwK+fs8igASvCMI= X-Received: by 2002:a5d:544e:: with SMTP id w14mr2306939wrv.227.1606902546472; Wed, 02 Dec 2020 01:49:06 -0800 (PST) Received: from [192.168.1.211] ([2.31.224.80]) by smtp.gmail.com with ESMTPSA id s8sm1349434wrn.33.2020.12.02.01.49.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 01:49:05 -0800 (PST) Subject: Re: [PATCH 16/18] i2c: i2c-core-base: Use the new i2c_acpi_dev_name() in i2c_set_dev_name() To: Andy Shevchenko , Laurent Pinchart Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, mika.westerberg@linux.intel.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, wsa@kernel.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux@rasmusvillemoes.dk, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, laurent.pinchart+renesas@ideasonboard.com, jorhand@linux.microsoft.com, kitakar@gmail.com, heikki.krogerus@linux.intel.com References: <20201130133129.1024662-1-djrscally@gmail.com> <20201130133129.1024662-17-djrscally@gmail.com> <20201130171241.GP14465@pendragon.ideasonboard.com> <20201130191856.GX4077@smile.fi.intel.com> <20201202093554.GT4077@smile.fi.intel.com> From: Dan Scally Message-ID: Date: Wed, 2 Dec 2020 09:49:04 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201202093554.GT4077@smile.fi.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/2020 09:35, Andy Shevchenko wrote: > Dan, does this mail among other my replies reach you? > It seems you answered to Laurent's mails and leaving mine ignored. Just > wondering if our servers have an issue again... Morning - I got it, sorry. I just read Laurent's first and then called it a night > On Mon, Nov 30, 2020 at 09:18:56PM +0200, Andy Shevchenko wrote: >> On Mon, Nov 30, 2020 at 07:12:41PM +0200, Laurent Pinchart wrote: >>> On Mon, Nov 30, 2020 at 01:31:27PM +0000, Daniel Scally wrote: >>>> From: Dan Scally >>>> >>>> To make sure the new i2c_acpi_dev_name() always reflects the name of i2c >>>> devices sourced from ACPI, use it in i2c_set_dev_name(). >>>> >>>> Signed-off-by: Dan Scally >>> I'd squash this with 15/18, which would make it clear there's a memory >>> leak :-) >> ... >> >>>> if (adev) { >>>> - dev_set_name(&client->dev, "i2c-%s", acpi_dev_name(adev)); >>>> + dev_set_name(&client->dev, i2c_acpi_dev_name(adev)); >>>> return; >> But you split pattern used in i2c_dev_set_name(). >> What you need is to provide something like this >> >> #define I2C_DEV_NAME_FORMAT "i2c-%s" >> >> const char *i2c_acpi_get_dev_name(...) >> { >> return kasprintf(..., I2C_DEV_NAME_FORMAT, ...); >> } >> >> (Possible in the future if anybody needs >> const char *i2c_dev_get_name_by_bus_and_addr(int bus, unsigned short addr) >> ) >> >> And here >> >> - dev_set_name(&client->dev, "i2c-%s", info->dev_name); >> + dev_set_name(&client->dev, I2C_DEV_NAME_FORMAT, info->dev_name); >> >> - dev_set_name(&client->dev, "i2c-%s", acpi_dev_name(adev)); >> + dev_set_name(&client->dev, I2C_DEV_NAME_FORMAT, acpi_dev_name(adev)); >> Yeah ok, I like this approach much better, I'll switch to that.