lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 07 Feb 2013 13:22:56 +0900
From:	jonghwa3.lee@...sung.com
To:	"devendra.aaru" <devendra.aaru@...il.com>
Cc:	linux-kernel@...r.kernel.org, a.zummo@...ertech.it,
	Andrew Morton <akpm@...ux-foundation.org>,
	rtc-linux@...glegroups.com
Subject: Re: [PATCH] rtc: max8997: Add driver for max8997 rtc.

On 2013년 02월 07일 13:14, devendra.aaru wrote:
> Hello,
> 
> On Wed, Feb 6, 2013 at 4:53 PM, Jonghwa Lee <jonghwa3.lee@...sung.com> wrote:
>> This patch adds rtc driver for Maxim 8997 multifunction chip.
>> Max8997 has rtc module in it. and it can be used for timekeeping
>> clock and system alarm. It provide various operational mode those are
>> BCD/binary, 24/12hour, am/pm. Driver sets binary/24/ for default.
>> Maxim 8997 also supports SMPL(Sudden Momentary Power Loss), WTSR
>> (Watchdog Timeout and Software Reset).
>>
>> Signed-off-by: Jonghwa Lee <jonghwa3.lee@...sung.com>
>> ---
>>  drivers/rtc/Kconfig       |   30 +++
>>  drivers/rtc/Makefile      |    1 +
>>  drivers/rtc/rtc-max8997.c |  542 +++++++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 573 insertions(+)
>>  create mode 100644 drivers/rtc/rtc-max8997.c
>>
>> +
>> +static int max8997_rtc_probe(struct platform_device *pdev)
>> +{
>> +       struct max8997_dev *max8997 = dev_get_drvdata(pdev->dev.parent);
>> +       struct max8997_rtc_info *info;
>> +       int ret, virq;
>> +
>> +       info = devm_kzalloc(&pdev->dev, sizeof(struct max8997_rtc_info),
>> +                       GFP_KERNEL);
>> +       if (!info)
>> +               return -ENOMEM;
>> +
>> +       mutex_init(&info->lock);
>> +       info->dev = &pdev->dev;
>> +       info->max8997 = max8997;
>> +       info->rtc = max8997->rtc;
>> +
>> +       platform_set_drvdata(pdev, info);
>> +
>> +       ret = max8997_rtc_init_reg(info);
>> +
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to initialize RTC reg:%d\n", ret);
>> +               return ret;
>> +       }
>> +
>> +       max8997_rtc_enable_wtsr(info, true);
>> +       max8997_rtc_enable_smpl(info, true);
>> +
>> +       device_init_wakeup(&pdev->dev, 1);
>> +
>> +       info->rtc_dev = rtc_device_register("max8997-rtc", &pdev->dev,
>> +                       &max8997_rtc_ops, THIS_MODULE);
>> +
>> +       if (IS_ERR(info->rtc_dev)) {
>> +               ret = PTR_ERR(info->rtc_dev);
>> +               dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
>> +               return ret;
>> +       }
>> +
>> +       virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1);
>> +       if (!virq) {
>> +               dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
>    +               rtc_device_unregister(&pdev->dev, &max8997_rtc_ops) ?

Yes, It should be,,

>> +               return ret;
>> +       }
>> +       info->virq = virq;
>> +
>> +       ret = request_threaded_irq(virq, NULL, max8997_rtc_alarm_irq, 0,
>> +                               "rtc-alarm0", info);
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
>> +                       info->virq, ret);
>    +               here unregistering the rtc dev too?

also

>> +               return ret;
>> +       }
>> +
>> +       return ret;
>> +}
>> +
> 

Thanks for reviewing, I'll fix it.

Thanks,
Jonghwa

> 
> Thanks,
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ