Re: [PATCH v5] MIPS: Expose prid and globalnumber to sysfs

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

 




在2022年10月7日十月 下午3:52,Greg KH写道:
[...]
>> +
>> +static int cpuregs_cpu_offline(unsigned int cpu)
>> +{
>> +	struct device *dev;
>> +	struct cpureg *reg = per_cpu(cpuregs, cpu);
>> +
>> +	dev = get_cpu_device(cpu);
>> +	if (!dev || !reg)
>> +		return -ENODEV;
>> +	if (reg->kobj.parent) {
>
> Why are you looking at the parent of a kobject?  Why not just always
> remove the kobject if you have a reference to it now?  How does the
> parent matter?

Another dummy copy from Arm64 code... kobject_put should be enough here?

Thanks

>
> thanks,
>
> greg k-h

-- 
- Jiaxun




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux