lkml.org 
[lkml]   [2022]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/3] drivers: misc: intel_sysid: Add sysid from arch to drivers
From
Thanks for the review Greg,

>> +static int intel_sysid_probe(struct platform_device *pdev)
>> +{
>> + struct intel_sysid *sysid;
>> + struct resource *regs;
>> +
>> + sysid = devm_kzalloc(&pdev->dev, sizeof(struct intel_sysid),
>> + GFP_KERNEL);
>> + if (!sysid)
>> + return -ENOMEM;
>> +
>> + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> + if (!regs)
>> + return -ENXIO;
>> +
>> + sysid->regs = devm_ioremap_resource(&pdev->dev, regs);
>> + if (IS_ERR(sysid->regs))
>> + return PTR_ERR(sysid->regs);
>> +
>> + platform_set_drvdata(pdev, sysid);
>> +
>> + return devm_device_add_group(&pdev->dev, &intel_sysid_attr_group);
>
> You just raced with userspace and lost. Please use the default group
> for the platform device.
>
> I need to go remove this function, it should not be used at all as it is
> broken.

Can you elaborate on the issue and suggested replacement?

We used this function for the SoundWire sysfs based on your review
comments (2 years ago?) that we should not muck with kobj, and that
function devm_device_add_group() is also used in a probe function.

Thanks!
-Pierre

\
 
 \ /
  Last update: 2022-07-28 17:38    [W:0.092 / U:1.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site