Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp70436imm; Tue, 3 Jul 2018 14:08:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQ+jH+ITsPHLHONGL2QyzUx4hHVxQ+j7bMhzn9Gmn/B2c0SA6LPo6vRmmsGjp9dIwL+o19 X-Received: by 2002:a62:f52:: with SMTP id x79-v6mr3060113pfi.123.1530652111818; Tue, 03 Jul 2018 14:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530652111; cv=none; d=google.com; s=arc-20160816; b=v9ys6xtSpm9Wl7hz8ExrzlLSbbI4kTBg7SEacwJbdE7594dj17EjH5TKVHrI3an6Gj UVUenOj5i4CfoX+d4gzwFzlQhk1V9wmqzgGbI4iL4u8Su5Q+o3vBfpbbmkzoTxNEs4vv UXFGXqqaD9bx6cSQdxD8ssip6M8szaEJnu0i28hrId4miEFHUH3Aj09AXyK5Or2Yl2ia L6vf6FEpMDDe2xxoGPnFnSqcRujeTtlubRpmuvxAS9mgxJa025npr3bPSGvXnrCFkio3 N8gbJel2BaJxXOybiKjJGyCCQrHtk5KAEHzuOprlE5fiPbYwX27VH+OanO3/B02m8tnm WPVA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=/9RB/5mCLa3i3/vpf5O1Du1z9gOoB955j6bpXGe1Ugc=; b=N51LsFwFwkGaEAGjanpegFslD0Nt9Y5ur1dme63e6AKZQgjcYqwRoxYHafBhGD8D4N PBIF7fFG5RMAbO1vMu3sLVWPkA3pPe6/FkberpLo8IoWCXx1NLZBw2ikX+nuSlrwLasY u72o8InEidB8O84VYKZYYyi33U/SYy/cacOxAdNvHJAQGjwwdA3kJXBFvgjNOmpa+1Fq XH7S5DIPhpCakrIfTovnSJISiOn0PYdohn50fnzniNlefzy5McBm9AQXGVee0/2EJPtE 6+CD0vRPhJq1Oscp1TDBbDGfvb374fvl8WCK8szX9Ryw7LwFwNWMRMTcG45ZdYtmjqwC Cbug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Wo2qksBi; 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 128-v6si879015pff.55.2018.07.03.14.08.15; Tue, 03 Jul 2018 14:08:31 -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=Wo2qksBi; 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 S1753171AbeGCVH1 (ORCPT + 99 others); Tue, 3 Jul 2018 17:07:27 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:43397 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752910AbeGCVHZ (ORCPT ); Tue, 3 Jul 2018 17:07:25 -0400 Received: by mail-vk0-f65.google.com with SMTP id d74-v6so1915883vke.10; Tue, 03 Jul 2018 14:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/9RB/5mCLa3i3/vpf5O1Du1z9gOoB955j6bpXGe1Ugc=; b=Wo2qksBi44K/+H06tox/6MyDuyCoShwPctEaamrSMt/C1wyBSWMwXUBYvFORu3zU/z 3dNUzPW2XDMrOT+YZcXTvrX4G8QBGJQ64XesxkXiYUU/p1ES84G9/irGutOklRmO1T9J Ph45oh14Y4xdUCkh+bYw9zlyZ+tLlAMLe5GgiFSVlXfiSsYhej2bCEZAMV58+P0bzdqc NywdiuxkidUeu+JkaifcxWnIFr36Ar/ELcUIqIKLJM8L6QeM/t/Kb+xpeZwTOFLRf6Wn u1sL4uWIkBbJrs3P+JJq6fKR8BNIWmRyx38HtuhdMK2Y3/mqu31t+9gE63lh8R/yP2HS l8KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/9RB/5mCLa3i3/vpf5O1Du1z9gOoB955j6bpXGe1Ugc=; b=Za/Z3lC54f0ygtdghH4erB2WOX0tEnVFtEkEN8MYZ+u8NjAduVm+YtPmtywbNB1aN3 YCFdRtb7I0jnq6r9xX1nnqxi+aQ9SpiZ/U7x6hEcUHi8tXPy6eMUEFgOJduewePGSvJs tNeUoR3sASBPeicm0iVYKZOI7WUHH49/FQkWbwGs29x4ybNvYpcE655ZyJS6AwD44cFJ gVDtHXzRHjqBGB9xgUPTBhE/9mQkWZ62WVmvJRr2vzDegUcdxOf4SOjwSlvH4AO2ptbL Ep02AcX2tLIsPWn9sJn6XDzyYxhglLWTgoS3qbvX6v4PZGapd9Kodax1g/3K+yGO7gXr b2mQ== X-Gm-Message-State: APt69E1BwYtUDalFMjT+qk2sh8UuaXLXFvr7DuRyTW/VjPpMTSNJYsQ+ sdyhZ5FhVMNXBQGzBynYJqgLZuDOHdVjqZXNTQK5lFYc X-Received: by 2002:a1f:6dc4:: with SMTP id i187-v6mr4059845vkc.131.1530652044155; Tue, 03 Jul 2018 14:07:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 14:07:23 -0700 (PDT) In-Reply-To: <1212fde5edcf360231282c9d2487712fc5b4d6f8.1530599660.git.nikolaus.voss@loewensteinmedical.de> References: <1212fde5edcf360231282c9d2487712fc5b4d6f8.1530599660.git.nikolaus.voss@loewensteinmedical.de> From: Andy Shevchenko Date: Wed, 4 Jul 2018 00:07:23 +0300 Message-ID: Subject: Re: [PATCH v2 1/2] IIO: st_accel_i2c.c: Simplify access to driver data To: Nikolaus Voss Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Lorenzo Bianconi , Linus Walleij , Xiongfeng Wang , nv@vosn.de, linux-iio@vger.kernel.org, Linux Kernel Mailing List 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 Tue, Jul 3, 2018 at 8:41 AM, Nikolaus Voss wrote: > Use device_get_match_data API to simplify access to driver data. ..._data() But. You actually don't use it below. > Let acpi_device_id table entries point to the same driver data as > of_device_id table entries and uniquify access to driver data by using > device_get_match_data API. > #include > #include > #include > +#include (linux/property.h) > + match = of_device_get_match_data(&client->dev); > + if (!match) > + match = acpi_device_get_match_data(&client->dev); What I meant is to simply call match = device_get_match_data(...); > + if (match) > + strlcpy(client->name, match, sizeof(client->name)); -- With Best Regards, Andy Shevchenko