mirror of https://gitee.com/openkylin/linux.git
x86/hpet: Decapitalize and rename EVT_TO_HPET_DEV
It's a function not a macro and the upcoming changes use channel for the individual hpet timer units to allow a step by step refactoring approach. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Cc: Ashok Raj <ashok.raj@intel.com> Cc: Andi Kleen <andi.kleen@intel.com> Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> Cc: Stephane Eranian <eranian@google.com> Cc: Ravi Shankar <ravi.v.shankar@intel.com> Link: https://lkml.kernel.org/r/20190623132435.241032433@linutronix.de
This commit is contained in:
parent
44b5be5733
commit
3535aa12f7
|
@ -69,9 +69,10 @@ static bool hpet_verbose;
|
||||||
|
|
||||||
static struct clock_event_device hpet_clockevent;
|
static struct clock_event_device hpet_clockevent;
|
||||||
|
|
||||||
static inline struct hpet_dev *EVT_TO_HPET_DEV(struct clock_event_device *evtdev)
|
static inline
|
||||||
|
struct hpet_dev *clockevent_to_channel(struct clock_event_device *evt)
|
||||||
{
|
{
|
||||||
return container_of(evtdev, struct hpet_dev, evt);
|
return container_of(evt, struct hpet_dev, evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned int hpet_readl(unsigned int a)
|
inline unsigned int hpet_readl(unsigned int a)
|
||||||
|
@ -458,28 +459,22 @@ void hpet_msi_write(struct hpet_dev *hdev, struct msi_msg *msg)
|
||||||
|
|
||||||
static int hpet_msi_shutdown(struct clock_event_device *evt)
|
static int hpet_msi_shutdown(struct clock_event_device *evt)
|
||||||
{
|
{
|
||||||
struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
|
return hpet_shutdown(evt, clockevent_to_channel(evt)->num);
|
||||||
|
|
||||||
return hpet_shutdown(evt, hdev->num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hpet_msi_set_oneshot(struct clock_event_device *evt)
|
static int hpet_msi_set_oneshot(struct clock_event_device *evt)
|
||||||
{
|
{
|
||||||
struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
|
return hpet_set_oneshot(evt, clockevent_to_channel(evt)->num);
|
||||||
|
|
||||||
return hpet_set_oneshot(evt, hdev->num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hpet_msi_set_periodic(struct clock_event_device *evt)
|
static int hpet_msi_set_periodic(struct clock_event_device *evt)
|
||||||
{
|
{
|
||||||
struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
|
return hpet_set_periodic(evt, clockevent_to_channel(evt)->num);
|
||||||
|
|
||||||
return hpet_set_periodic(evt, hdev->num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hpet_msi_resume(struct clock_event_device *evt)
|
static int hpet_msi_resume(struct clock_event_device *evt)
|
||||||
{
|
{
|
||||||
struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
|
struct hpet_dev *hdev = clockevent_to_channel(evt);
|
||||||
struct irq_data *data = irq_get_irq_data(hdev->irq);
|
struct irq_data *data = irq_get_irq_data(hdev->irq);
|
||||||
struct msi_msg msg;
|
struct msi_msg msg;
|
||||||
|
|
||||||
|
@ -491,16 +486,14 @@ static int hpet_msi_resume(struct clock_event_device *evt)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hpet_msi_next_event(unsigned long delta,
|
static int hpet_msi_next_event(unsigned long delta,
|
||||||
struct clock_event_device *evt)
|
struct clock_event_device *evt)
|
||||||
{
|
{
|
||||||
struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
|
return hpet_next_event(delta, clockevent_to_channel(evt)->num);
|
||||||
|
|
||||||
return hpet_next_event(delta, hdev->num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t hpet_interrupt_handler(int irq, void *data)
|
static irqreturn_t hpet_interrupt_handler(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct hpet_dev *dev = (struct hpet_dev *)data;
|
struct hpet_dev *dev = data;
|
||||||
struct clock_event_device *hevt = &dev->evt;
|
struct clock_event_device *hevt = &dev->evt;
|
||||||
|
|
||||||
if (!hevt->event_handler) {
|
if (!hevt->event_handler) {
|
||||||
|
|
Loading…
Reference in New Issue