Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933376AbeAHN3q (ORCPT + 1 other); Mon, 8 Jan 2018 08:29:46 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40246 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933350AbeAHN3j (ORCPT ); Mon, 8 Jan 2018 08:29:39 -0500 X-Google-Smtp-Source: ACJfBotZxQ4g9x0MgkuhNYVy8KwKUNqty9OHOlFM665o+c+MFt0XQEX78N655NZnksi7JW0/tSgA5g== From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: [PATCH 09/20] clocksource/drivers/timer-of: Store the device node pointer Date: Mon, 8 Jan 2018 14:28:48 +0100 Message-Id: <1515418139-23276-9-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515418139-23276-1-git-send-email-daniel.lezcano@linaro.org> References: <1bbaef2e-4080-3f54-7db3-a8989acfd691@free.fr> <1515418139-23276-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Under certain circumstances, some specific operations must be done with the device node pointer, that forces the timer code to propagate the pointer to the functions which need it. In order to consolidate the function signatures in the different drivers by using the timer-of structure, let's store it in the timer-of structure as a handy pointer when it is needed. Signed-off-by: Daniel Lezcano Tested-by: Benjamin Gaignard Acked-by: Benjamin Gaignard --- drivers/clocksource/timer-of.c | 3 +++ drivers/clocksource/timer-of.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index 2af8b8a..2ae348b 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -201,6 +201,9 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) if (!to->clkevt.name) to->clkevt.name = np->name; + + to->np = np; + return ret; out_fail: diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h index 3f708f1..a5478f3 100644 --- a/drivers/clocksource/timer-of.h +++ b/drivers/clocksource/timer-of.h @@ -33,6 +33,7 @@ struct of_timer_clk { struct timer_of { unsigned int flags; + struct device_node *np; struct clock_event_device clkevt; struct of_timer_base of_base; struct of_timer_irq of_irq; -- 2.7.4