Re: [PATCH 11/15] media: atomisp: Replace atomisp_drvfs attr with using driver.dev_groups attr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On 1/2/24 22:23, Andy Shevchenko wrote:
> On Tue, Jan 2, 2024 at 1:30 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>> On 1/2/24 01:33, Andy Shevchenko wrote:
>>> On Sun, Dec 31, 2023 at 12:31 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> 
> ...
> 
>>>> +static const struct attribute_group dbg_attr_group = {
>>>> +       .attrs = dbg_attrs,
>>>> +};
>>>>
>>>> +const struct attribute_group *dbg_attr_groups[] = {
>>>> +       &dbg_attr_group,
>>>> +       NULL
>>>> +};
>>>
>>> ATTRIBUTE_GROUPS()
>>
>> I deliberately wrote this out (had to write this out)
>> instead of using ATTRIBUTE_GROUPS() because ATTRIBUTE_GROUPS()
>> makes the groups variable static and here it gets used
>> in another file then where it is declared.
> 
> I see, but can it be refactored / does it make sense to refactor that
> it becomes visible only in one module?

The problem is that all the sysfs attr handling code lives
in its own .c file, where as the driver struct is in another
.c file, so we really need to access the list of
attribute-groups from another file then where the list is
declared, which makes the ATTRIBUTE_GROUPS() macro
unsuitable.

Regards,

Hans







[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux