lkml.org 
[lkml]   [2021]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/17] rtc: mv: remove mv_rtc_alarm_ops
    Date
    Move the alarm callbacks in mv_rtc_ops and clear RTC_FEATURE_ALARM to
    signal that alarms are not available instead of having a supplementary
    struct rtc_class_ops.

    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    ---
    drivers/rtc/rtc-mv.c | 14 ++++----------
    1 file changed, 4 insertions(+), 10 deletions(-)

    diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
    index f8e2ecea1d8d..6c526e2ec56d 100644
    --- a/drivers/rtc/rtc-mv.c
    +++ b/drivers/rtc/rtc-mv.c
    @@ -200,11 +200,6 @@ static irqreturn_t mv_rtc_interrupt(int irq, void *data)
    static const struct rtc_class_ops mv_rtc_ops = {
    .read_time = mv_rtc_read_time,
    .set_time = mv_rtc_set_time,
    -};
    -
    -static const struct rtc_class_ops mv_rtc_alarm_ops = {
    - .read_time = mv_rtc_read_time,
    - .set_time = mv_rtc_set_time,
    .read_alarm = mv_rtc_read_alarm,
    .set_alarm = mv_rtc_set_alarm,
    .alarm_irq_enable = mv_rtc_alarm_irq_enable,
    @@ -268,13 +263,12 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
    }
    }

    - if (pdata->irq >= 0) {
    + if (pdata->irq >= 0)
    device_init_wakeup(&pdev->dev, 1);
    - pdata->rtc->ops = &mv_rtc_alarm_ops;
    - } else {
    - pdata->rtc->ops = &mv_rtc_ops;
    - }
    + else
    + clear_bit(RTC_FEATURE_ALARM, pdata->rtc->features);

    + pdata->rtc->ops = &mv_rtc_ops;
    pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
    pdata->rtc->range_max = RTC_TIMESTAMP_END_2099;

    --
    2.29.2
    \
     
     \ /
      Last update: 2021-01-11 00:21    [W:2.658 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site