Re: [PATCH 2/3] rtc: ds1685: use correct device struct to get platform device struct

Alexandre Belloni
2019-04-12T10:11:11Z

Hi,

Every patch need a commit message. Maybe you could indicate that this
never gave any issue because parent is the first member of struct
device.

On 11/04/2019 16:33:22+0200, Thomas Bogendoerfer wrote:
> Fixes: aaaf5fbf56f1 ("rtc: add driver for DS1685 family of real time clocks")
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
> ---
> drivers/rtc/rtc-ds1685.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> index 2f5194df239e..929f28375b87 100644
> --- a/drivers/rtc/rtc-ds1685.c
> +++ b/drivers/rtc/rtc-ds1685.c
> @@ -655,7 +655,7 @@ ds1685_rtc_work_queue(struct work_struct *work)
> {
> struct ds1685_priv *rtc = container_of(work,
> struct ds1685_priv, work);
> - struct platform_device *pdev = to_platform_device(&rtc->dev->dev);
> + struct platform_device *pdev = to_platform_device(rtc->dev->dev.parent);
> struct mutex *rtc_mutex = &rtc->dev->ops_lock;
> u8 ctrl4a, ctrl4b;
>
> --
> 2.13.7
>

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering