The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@free-electrons.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: dmitry.torokhov@gmail.com, wens@csie.org, lee.jones@linaro.org,
	hdegoede@redhat.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	thomas.petazzoni@free-electrons.com
Subject: Re: [PATCH 1/2] Input: axp20x-pek: add support for AXP221 PEK
Date: Tue, 18 Jul 2017 10:10:24 +0200	[thread overview]
Message-ID: <fcd4fd4e-4387-b2af-7c5f-39b772de9371@free-electrons.com> (raw)
In-Reply-To: <20170718075707.h2ul6vlhsco4ts5u@flea>


[-- Attachment #1.1: Type: text/plain, Size: 1263 bytes --]

Hi Maxime,

On 18/07/2017 09:57, Maxime Ripard wrote:
> On Tue, Jul 18, 2017 at 09:36:04AM +0200, Quentin Schulz wrote:
>>>> +
>>>> +	error = sysfs_create_group(&pdev->dev.kobj,
>>>> +				   axp20x_pek->attribute_group);
>>>
>>> Wouldn't it make more sense to just store the startup_time structure
>>> in the axp20x_pek structure, rather than duplicating all this?
>>>
>>
>> I don't know. Basically, you would need to recreate manually all the
>> structures in the probe function, but why not.
> 
> Why?
> 
> You have access to axp20x_pek in the readout function. You can just
> use the table stored in the structure here, and just ignore any
> argument you might have.
> 

All I'm saying is that:
struct axp20x_time is referenced in struct axp20x_pek_ext_attr which in
turn is referenced in struct dev_ext_attribute which is referenced in
struct attribute which is reference in const struct attribute_group
which is finally used to add/remove a sysfs group programmatically.

The earlier in the chain you decide to stop duplicating code, the most
structures you have to programmatically create. That was my point.

Quentin

-- 
Quentin Schulz, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-07-18  8:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17  9:53 [PATCH 0/2] use correct values for startup time bits for AXP22X/AXP8XX PEKs Quentin Schulz
2017-07-17  9:53 ` [PATCH 1/2] Input: axp20x-pek: add support for AXP221 PEK Quentin Schulz
2017-07-17 11:29   ` Maxime Ripard
2017-07-18  7:36     ` Quentin Schulz
2017-07-18  7:57       ` Maxime Ripard
2017-07-18  8:10         ` Quentin Schulz [this message]
2017-07-17  9:53 ` [PATCH 2/2] mfd: axp20x: use correct platform device id for many PEK Quentin Schulz
2017-07-18  7:19   ` Lee Jones
2017-07-18  7:43     ` Quentin Schulz
2017-07-18  9:49       ` Lee Jones
2017-07-18 10:04         ` Quentin Schulz
2017-07-18 10:26           ` Lee Jones
2017-07-18 10:28   ` Lee Jones
2017-07-17 11:15 ` [PATCH 0/2] use correct values for startup time bits for AXP22X/AXP8XX PEKs Quentin Schulz
2017-07-18  7:18   ` Lee Jones
2017-07-18  7:25     ` Quentin Schulz
2017-07-18  7:40       ` Chen-Yu Tsai
2017-07-18  9:53         ` Lee Jones
2017-07-19  7:24           ` Chen-Yu Tsai
2017-07-19  7:46             ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcd4fd4e-4387-b2af-7c5f-39b772de9371@free-electrons.com \
    --to=quentin.schulz@free-electrons.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox