Re: [RFC PATCH 20/57] platform: Add a helper to find device by driver

From: Heiko Stuebner
Date: Tue Jun 04 2019 - 09:33:04 EST


Hi,

Am Montag, 3. Juni 2019, 17:49:46 CEST schrieb Suzuki K Poulose:
> There are a couple of places where we reuse platform specific
> match to find a device. Instead of spilling the global varilable
> everywhere, let us provide a helper to do the same.
>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
> Cc: Inki Dae <inki.dae@xxxxxxxxxxx>
> Cc: Seung-Woo Kim <sw0312.kim@xxxxxxxxxxx>
> Cc: Sandy Huang <hjc@xxxxxxxxxxxxxx>
> Cc: "Heiko Stübner" <heiko@xxxxxxxxx>
> Cc: Eric Anholt <eric@xxxxxxxxxx>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>

> diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
> index cc46485..a82b3ec 100644
> --- a/include/linux/platform_device.h
> +++ b/include/linux/platform_device.h
> @@ -52,6 +52,9 @@ extern struct device platform_bus;
> extern void arch_setup_pdev_archdata(struct platform_device *);
> extern struct resource *platform_get_resource(struct platform_device *,
> unsigned int, unsigned int);
> +extern struct device *
> +platform_find_device_by_driver(struct device dev*,
> + const struct device_driver *drv);

the "dev*" causes compilation errors and also doesn't match the
function definition. With "dev*" -> "*start" it compiles again and
my rockchip drm driver still manages to find its components, so
after the above issue is fixed:

Tested-by: Heiko Stuebner <heiko@xxxxxxxxx>