<commit_before>/* rtc-parisc: RTC for HP PA-RISC firmware
 *
 * Copyright (C) 2008 <NAME> <<EMAIL>>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>

#include <asm/rtc.h>

static int parisc_get_time(struct device *dev, struct rtc_time *tm)
{
	unsigned long ret;

	ret = get_rtc_time(tm);

	if (ret & RTC_BATT_BAD)
		return -EOPNOTSUPP;

	return rtc_valid_tm(tm);
}

static int parisc_set_time(struct device *dev, struct rtc_time *tm)
{
	if (set_rtc_time(tm) < 0)
		return -EOPNOTSUPP;

	return 0;
}

static const struct rtc_class_ops parisc_rtc_ops = {
	.read_time = parisc_get_time,
	.set_time = parisc_set_time,
};

static int __init parisc_rtc_probe(struct platform_device *dev)
{
	struct rtc_device *p;

	p = rtc_device_register("rtc-parisc", &dev->dev, &parisc_rtc_ops,
				THIS_MODULE);
	if (IS_ERR(p))
		return PTR_ERR(p);

	platform_set_drvdata(dev, p);

	return 0;
}

static int __exit parisc_rtc_remove(struct platform_device *dev)
{
	struct rtc_device *p = platform_get_drvdata(dev);

	rtc_device_unregister(p);<commit_msg>rtc-parisc: rename p pointer to rtc<commit_after>/* rtc-parisc: RTC for HP PA-RISC firmware
 *
 * Copyright (C) 2008 <NAME> <<EMAIL>>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/platform_device.h>
#include <linux/rtc.h>

#include <asm/rtc.h>

static int parisc_get_time(struct device *dev, struct rtc_time *tm)
{
	unsigned long ret;

	ret = get_rtc_time(tm);

	if (ret & RTC_BATT_BAD)
		return -EOPNOTSUPP;

	return rtc_valid_tm(tm);
}

static int parisc_set_time(struct device *dev, struct rtc_time *tm)
{
	if (set_rtc_time(tm) < 0)
		return -EOPNOTSUPP;

	return 0;
}

static const struct rtc_class_ops parisc_rtc_ops = {
	.read_time = parisc_get_time,
	.set_time = parisc_set_time,
};

static int __init parisc_rtc_probe(struct platform_device *dev)
{
	struct rtc_device *rtc;

	rtc = rtc_device_register("rtc-parisc", &dev->dev, &parisc_rtc_ops,
				  THIS_MODULE);
	if (IS_ERR(rtc))
		return PTR_ERR(rtc);

	platform_set_drvdata(dev, rtc);

	return 0;
}

static int __exit parisc_rtc_remove(struct platform_device *dev)
{
	struct rtc_device *rtc = platform_get_drvdata(dev);

	rtc_device_unregister(rtc);
{'fraction_non_alphanumeric': 0.12335958005249344, 'fraction_numerical': 0.006124234470691163, 'mean_word_length': 5.034300791556729, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7452744', 'n_tokens_mistral': 967, 'n_tokens_neox': 915, 'n_words': 206}