Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1710790

Re: [PATCH v3 1/2] Input: axp20x-pek: use driver_data of platform_device_id instead of extended attributes

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Chen-Yu Tsai <wens@csie.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/2] Input: axp20x-pek: use driver_data of platform_device_id instead of extended attributes
Date Mon, 14 Aug 2017 12:10:02 +0200
Message-ID <uektQ-2Py-11@gated-at.bofh.it> (permalink)
References <ucvMJ-5na-3@gated-at.bofh.it> <ucvMJ-5na-1@gated-at.bofh.it>
X-Gm-Message-State AHYfb5gjIfWJlNENha6jjXqcacbokf8h9rtkHcjgv31xJw5aD7HgcviX Zsie/L+tErBpL7IUOqQEbH49txw6Lg==
X-Received by 10.36.65.205 with SMTP id b74mr5235385itd.122.1502705044962; Mon, 14 Aug 2017 03:04:04 -0700 (PDT)
MIME-Version 1.0
X-Gmail-Original-Message-ID <CAGb2v65xoUZA+AGb+1LEba-ccmDdLo6YyAB1nqo2uKUN7x=2kA@mail.gmail.com>
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc Dmitry Torokhov <dmitry.torokhov@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Lee Jones <lee.jones@linaro.org>, Hans de Goede <hdegoede@redhat.com>, "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>, linux-kernel <linux-kernel@vger.kernel.org>, Thomas Petazzoni <thomas.petazzoni@free-electrons.com>, Maxime Ripard <maxime.ripard@free-electrons.com>
X-Original-Date Mon, 14 Aug 2017 18:03:44 +0800
X-Original-Message-ID <CAGb2v65xoUZA+AGb+1LEba-ccmDdLo6YyAB1nqo2uKUN7x=2kA@mail.gmail.com>
X-Original-References <cover.634526c9e3d069f72bc162cdcaa9bb7c822d346a.1502271751.git-series.quentin.schulz@free-electrons.com> <df8eb78e18692292f5206a57c88fcefe6a1754de.1502271751.git-series.quentin.schulz@free-electrons.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1710790

Show key headers only | View raw


On Wed, Aug 9, 2017 at 5:45 PM, Quentin Schulz
<quentin.schulz@free-electrons.com> wrote:
> To prepare an upcoming patch adding support for another PMIC that has
> different startup and shutdown time, use driver_data of
> platform_device_id instead of a fixed extended device attribute.
>
> By doing so, we also remove a lot of nested structures that aren't
> useful.
>
> With this patch, a new PMIC can be easily supported by just filling
> correctly its ax20x_info structure and adding a platform_device_id.
>
> Moreover, since we get rid of extended attributes, rename
> axp20x_store_ext_attr to axp20x_store_attr and axp20x_show_ext_attr to
> axp20x_show_attr.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>

[...]

> +
> +DEVICE_ATTR(startup, 0644, axp20x_show_attr_startup, axp20x_store_attr_startup);
> +DEVICE_ATTR(shutdown, 0644, axp20x_show_attr_shutdown,
> +           axp20x_store_attr_shutdown);
>

You could use DEVICE_ATTR_RW(...) if you renamed the function names to
fit the macro if you wanted.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 1/2] Input: axp20x-pek: use driver_data of  platform_device_id instead of extended attributes Chen-Yu Tsai <wens@csie.org> - 2017-08-14 12:10 +0200
  Re: [PATCH v3 1/2] Input: axp20x-pek: use driver_data of  platform_device_id instead of extended attributes Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-08-17 02:50 +0200

csiph-web