Re: [RFC 1/3] drivers pps: add PPS generators support

From: Rodolfo Giometti
Date: Thu Oct 10 2024 - 04:22:04 EST


On 09/10/24 11:19, Greg KH wrote:
On Wed, Oct 09, 2024 at 10:48:14AM +0200, Rodolfo Giometti wrote:
+ kobject_put(&pps_gen->dev->kobj);

Messing with a kobject reference directly from a device feels wrong and
should never be done.

I followed the suggestions in this patch whose look sane to me:

https://lore.kernel.org/lkml/fc5fe55c-422d-4e63-a5bd-8b6b2d3e6c62@xxxxxxxxxxxx/T/

That patch is wrong.

:(

Please use the proper apis.

Which API are you talking about? Can you please provide some advice?

get_device()

You are working on devices, NOT a raw kobject, no driver should EVER be
calling into a kobject function or a sysfs function, there should be
driver core functions for everything you need to do.

OK, I'm going to provide a new RFC taking in account what you suggest.

Thanks,

Rodolfo

--
GNU/Linux Solutions e-mail: giometti@xxxxxxxxxxxx
Linux Device Driver giometti@xxxxxxxx
Embedded Systems phone: +39 349 2432127
UNIX programming