Re: [PATCH 02/20] net: xilinx: tsn: add TSN endpoint wrapper driver

Uwe Kleine-König <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.network,gmane.linux.drivers.devicetree,gmane.linux.ports.arm.kernel
Message-ID <anZGPKSopP9GLKJt@monoceros>
Hello,

On Fri, Aug 07, 2026 at 04:14:13PM +0530, Nagadheeraj Rottela wrote:
> diff --git a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
> new file mode 100644
> index 000000000000..1ef1b0c2ee6e
> --- /dev/null
> +++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
> @@ -0,0 +1,105 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/*
> + * Time Sensitive Networking (TSN) Ethernet MAC wrapper driver.
> + *
> + * Copyright (C) 2026 Advanced Micro Devices, Inc.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/device.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include <linux/types.h>

Please drop <linux/mod_devicetable.h>. This header is planned to go away
soon and you can rely on <linux/platform_device.h> to provide
of_device_id.

> [...]
> +static struct platform_driver * const tsn_drivers[] = {
> +	&tsn_driver,
> +};
> +
> +static int __init xlnx_tsn_init(void)
> +{
> +	return platform_register_drivers(tsn_drivers, ARRAY_SIZE(tsn_drivers));
> +}
> +module_init(xlnx_tsn_init);
> +
> +static void __exit xlnx_tsn_exit(void)
> +{
> +	platform_unregister_drivers(tsn_drivers, ARRAY_SIZE(tsn_drivers));
> +}
> +module_exit(xlnx_tsn_exit);

I assume you expect tsn_drivers[] to grow? If not, use
module_platform_driver() to reduce boilerplate.
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmp2RusACgkQj4D7WH0S
/k5magf9GDZifuMmMgVgWbOijgerh1NAUQiervav2kcbQ650bgaya6orUyAqUnnd
eGe7DyhyOOdkl3qnsTwH9/e4Xn739LEnnjAwWIBrFn56ErYRhl/Dd+vuD/9U0LPd
bGwI5ss9L6itgtlzGpZRsi4KhSiWG0asI7Ll3WFkUrhOdMd5a2+L22Vd47E3gXAo
lVQ7ntvXRliL54xVe1tVbSbz/JrN89nHRR7sI/FWjUEknfpTbVVldBt95gevSOc9
pVoI5wtCOSAMPQTzSAHFoj1qZcrOofeK49hvnUiasTy8OWa5oJiuCzHknYyPXcOS
JWFSEfqueZ+Xqyq+Y71krOsj8b+cYw==
=pHZr
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.