Re: [PATCH 2/3] ptp: Add clock name to uevent

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

 



>  
> +static int ptp_udev_uevent(const struct device *dev, struct kobj_uevent_env *env);

No forward declarations please. Put the code in the correct order.

>  const struct class ptp_class = {
>  	.name = "ptp",
> -	.dev_groups = ptp_groups
> +	.dev_groups = ptp_groups,
> +	.dev_uevent = ptp_udev_uevent
>  };
>  
>  /* private globals */
> @@ -514,6 +516,13 @@ EXPORT_SYMBOL(ptp_cancel_worker_sync);
>  
>  /* module operations */
>  
> +static int ptp_udev_uevent(const struct device *dev, struct kobj_uevent_env *env)
> +{
> +	struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev);
> +
> +	return add_uevent_var(env, "PTP_CLOCK_NAME=%s", ptp->info->name);
> +}

https://elixir.bootlin.com/linux/v6.11.3/source/include/linux/ptp_clock_kernel.h#L60

 * @name:      A short "friendly name" to identify the clock and to
 *             help distinguish PHY based devices from MAC based ones.
 *             The string is not meant to be a unique id.

If the name is not unique, you probably should not be using it for
udev naming.

	Andrew




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux