From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH v3 1/2] Input: axp20x-pek: use driver_data of platform_device_id instead of extended attributes Date: Wed, 16 Aug 2017 17:46:02 -0700 Message-ID: <20170817004602.GE25491@dtor-ws> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pg0-f68.google.com ([74.125.83.68]:33703 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbdHQAqF (ORCPT ); Wed, 16 Aug 2017 20:46:05 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Chen-Yu Tsai Cc: Quentin Schulz , Lee Jones , Hans de Goede , "linux-input@vger.kernel.org" , linux-kernel , Thomas Petazzoni , Maxime Ripard On Mon, Aug 14, 2017 at 06:03:44PM +0800, Chen-Yu Tsai wrote: > On Wed, Aug 9, 2017 at 5:45 PM, Quentin Schulz > 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 > > Acked-by: Chen-Yu Tsai Applied, thank you. > > [...] > > > + > > +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. -- Dmitry