[PATCH 05/13] spi: add driver for intel graphics on-die spi device

Krzysztof Kozlowski krzysztof.kozlowski at linaro.org
Fri Mar 29 05:43:40 PDT 2024


On 28/03/2024 13:22, Alexander Usyskin wrote:
> Add auxiliary driver for intel discrete graphics
> on-die spi device.
> 
> CC: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> Signed-off-by: Alexander Usyskin <alexander.usyskin at intel.com>
> ---
>  drivers/spi/Kconfig        |  11 +++
>  drivers/spi/Makefile       |   1 +
>  drivers/spi/spi-intel-dg.c | 146 +++++++++++++++++++++++++++++++++++++

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC (and consider --no-git-fallback argument). It might
happen, that command when run on an older kernel, gives you outdated
entries. Therefore please be sure you base your patches on recent Linux
kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline), work on fork of kernel
(don't, instead use mainline) or you ignore some maintainers (really
don't). Just use b4 and everything should be fine, although remember
about `b4 prep --auto-to-cc` if you added new patches to the patchset.

...

> +
> +	spi->base = devm_ioremap_resource(device, &ispi->bar);
> +	if (IS_ERR(spi->base)) {
> +		dev_err(device, "mmio not mapped\n");
> +		ret = PTR_ERR(spi->base);
> +		goto err;
> +	}
> +
> +	dev_set_drvdata(&aux_dev->dev, spi);
> +
> +	dev_dbg(device, "bound\n");

Sorry, no. No silly function success messages. There is existing
infrastructure for this. Drop.

> +
> +	return 0;
> +
> +err:
> +	kref_put(&spi->refcnt, intel_dg_spi_release);
> +	return ret;
> +}
> +
> +static void intel_dg_spi_remove(struct auxiliary_device *aux_dev)
> +{
> +	struct intel_dg_spi *spi = dev_get_drvdata(&aux_dev->dev);
> +
> +	if (!spi)
> +		return;
> +
> +	dev_set_drvdata(&aux_dev->dev, NULL);
> +
> +	kref_put(&spi->refcnt, intel_dg_spi_release);
> +}
> +
> +static const struct auxiliary_device_id intel_dg_spi_id_table[] = {
> +	{
> +		.name = "i915.spi",
> +	},
> +	{
> +		.name = "xe.spi",
> +	},
> +	{
> +		/* sentinel */
> +	}
> +};
> +MODULE_DEVICE_TABLE(auxiliary, intel_dg_spi_id_table);
> +
> +static struct auxiliary_driver intel_dg_spi_driver = {
> +	.probe  = intel_dg_spi_probe,
> +	.remove = intel_dg_spi_remove,
> +	.driver = {
> +		/* auxiliary_driver_register() sets .name to be the modname */
> +	},
> +	.id_table = intel_dg_spi_id_table
> +};
> +
> +module_auxiliary_driver(intel_dg_spi_driver);
> +
> +MODULE_ALIAS("auxiliary:i915.spi");
> +MODULE_ALIAS("auxiliary:xe.spi");

You should not need MODULE_ALIAS() in normal cases. If you need it,
usually it means your device ID table is wrong (e.g. misses either
entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute
for incomplete ID table.


Best regards,
Krzysztof




More information about the linux-mtd mailing list