Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4939420ybp; Mon, 14 Oct 2019 12:33:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYi7WWVMvKyfdYFZ5NzBMZoyAIvmK6keLrkGFsmwz1vyKHgdPekaXbaZlv8pV56+aaWBF+ X-Received: by 2002:a05:6402:1492:: with SMTP id e18mr29473814edv.140.1571081589742; Mon, 14 Oct 2019 12:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571081589; cv=none; d=google.com; s=arc-20160816; b=Zk/q9bI5mjOjUergPg6O4fz9hp7K4nG0o2WhlndWIkQTEtcYE74EYNssVzSd46a+JL ucK1oXVcKLB2yU0ap4Lb10+7fLVGE/dpZCd+cFtZ4a63k6i5LeuV2c/GE6Md9sDJcFJv Ar8myiyE+8TSM2gaNDH0WCQPTa3CzxSGbUjk0EOhKeoOON5sVlwXNC/2PzfShEumcQ5Z kMeyFi7zWr0k3ryvQy6csxHBq7u4yryuVU4c4LUvYc2CJUAd4cPY8dT843oSREUj/OxD /19EdodHy4bzCDeWycpC1oTY2984PVCeaBQBbBksQwC9EX0czNStjMsaRDiUsDgO8OBQ zHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8xeBjfnVagKgP5qH9jlyVR2d5Q7jiCa+79wJogu5uP8=; b=tHu9oj+0GRc7k9zjgmfZIXZ7C1TzOaWFm242ZUtzfA4BgOT05NjX63/8oU/qSfqzaz xh2UU7GUnajCyGUdU/n0UaAXudjk8BO2Ck99yAMg5RJo5QXe5GWk8ZaQ551yG5f3aQ8u 3/1RDBVI5ZgsauCk9RdCLy2c5Tq7MAnSQ/lufN6jxLyJ4E/wvRaJkq4ysxh3suiSTKiH RJDRfdF2eLP1AowRUxssyLiJjYbAU7o3D6ObS+dKMLHl/2heR44IatxTi28gbfXNey2P uFyz7QwsmJdH2sCNxnh+RFQh6Glz2I3kPDWWHpz2RPcvJMWTqwL76ZfhDt18nptML8PT fDuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AariQ55E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g23si11556135ejk.186.2019.10.14.12.32.46; Mon, 14 Oct 2019 12:33:09 -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=@gmail.com header.s=20161025 header.b=AariQ55E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731646AbfJNRuT (ORCPT + 99 others); Mon, 14 Oct 2019 13:50:19 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44150 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731602AbfJNRuT (ORCPT ); Mon, 14 Oct 2019 13:50:19 -0400 Received: by mail-pf1-f195.google.com with SMTP id q21so10775763pfn.11; Mon, 14 Oct 2019 10:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8xeBjfnVagKgP5qH9jlyVR2d5Q7jiCa+79wJogu5uP8=; b=AariQ55EpyrnjjO/eQh7fFTL53hkEDiXiVrE1qkNJZpz/NCLswHuSqaDmh88zuwY1B YxV53IAcfxRmiptihuXEymmcb/WijMbNFxhMe7k1Gv8Yoo/OcayoZGkXQt/LuGA38Lhe 60wCyWnzcLT5n0+8tFd6kv1zXAow0KDHb7p8P6fqT6mlpHz+G1VOPOhR0G+tnvnBGHal 5UNfaSJTq1jFmlLFTM5rSZrGpSfEHgYISCEiSH5/pWcExMCtYzhL8BlBUevSsA+xwBec nJusUVCl3igDuvgx+MBIfMb9hcWHqhJpzLh8ZcBnX4GicW+9RaRtCbL7N+5I+2LToC7a z9Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8xeBjfnVagKgP5qH9jlyVR2d5Q7jiCa+79wJogu5uP8=; b=M0UOodp7BrVI7aAAO02ewsRVwbFvTq7zdDLoZBIv59WXT+OXAVucJR8uUjY9wd6mle bebDQEikk7McV0MZK6pEwJsab08m/tDupJioPpWE6cSbmf98VHA2N122iqRa5m239Ph7 DK6olPOYf/1zWQ/3kTmopq0GvD+Ke9uxt/k24wJRe053bHmyiLpn3JIAF93jWFJ20FEz 9QVg/5i4ERPOAStS0QdcpZhAGrlsI2MsuC7kcZaA4mDI9hfDILotcVvupFpQJo4NPf+q pj0ScUzHEgiDwFKZ1xQGKrQw76sPhjKvlty5VwGn+4vK6PjyABUgZxpOvka39gxllAtM yzFQ== X-Gm-Message-State: APjAAAX7JWGqYWLkcwyp/5wpObx8cZlqhqcyKPeNSXQSC1kSYvb1zAu0 8XkG5OhQfc+t8wMMIx7hnw75u5nRdZeEpBnNG1M= X-Received: by 2002:a62:e206:: with SMTP id a6mr34056152pfi.64.1571075418730; Mon, 14 Oct 2019 10:50:18 -0700 (PDT) MIME-Version: 1.0 References: <20191004214334.149976-1-swboyd@chromium.org> <20191004214334.149976-2-swboyd@chromium.org> In-Reply-To: <20191004214334.149976-2-swboyd@chromium.org> From: Andy Shevchenko Date: Mon, 14 Oct 2019 20:50:06 +0300 Message-ID: Subject: Re: [PATCH 01/10] leds: pca953x: Use of_device_get_match_data() To: Stephen Boyd , Wolfram Sang Cc: Linux Kernel Mailing List , Arnd Bergmann , Geert Uytterhoeven , Riku Voipio , Rob Herring , Frank Rowand , Jacek Anaszewski , Pavel Machek , Dan Murphy , Linux LED Subsystem 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 On Sat, Oct 5, 2019 at 12:47 AM Stephen Boyd wrote: > > This driver can use the of_device_get_match_data() API to simplify the > code. Replace calls to of_match_device() with this newer API under the > assumption that where it is called will be when we know the device is > backed by a DT node. This nicely avoids referencing the match table when > it is undefined with configurations where CONFIG_OF=n. > + devid = (int)(uintptr_t)of_device_get_match_data(dev); > + devid = (int)(uintptr_t)of_device_get_match_data(&client->dev); This still leaves it OF-centric. Better to use device_get_match_data(). Also, I'm thinking that following may help to clean a lot of the i2c client drivers static inline // perhaps no const void *i2c_device_get_match_data(struct i2c_client *client, const struct i2c_device_id *id) { if (id) return (const void *)id->driver_data; return device_get_match_data(&client->dev); } -- With Best Regards, Andy Shevchenko