<commit_before>#include <linux/module.h>

#include <linux/init.h>
#include <linux/fs.h>
#include <linux/platform_device.h>
#include <linux/input.h>

static int temp=0, hum=0;
static struct platform_device *oduinoSensor;

static ssize_t sensorShow(struct device *dev, struct device_attribute *attr, 
				char *buffer){
	sprintf(buffer, "%d %d", temp, hum);
	return 0;
}

static ssize_t sensorStore(struct device *dev, struct device_attribute *attr, 
				const char *buffer, size_t count){
	sscanf(buffer, "%d %d", &temp, &hum);
	return 0;
}

DEVICE_ATTR(oduino_sensor, 0644, sensorShow, sensorStore);



static int __init oduinoSensor_init(void){
	
	oduinoSensor = platform_device_register_simple("oduinoSensor", -1, NULL, 0);
	if(IS_ERR(oduinoSensor)){
		printk("oduinoSensor_init : error during platfrom device register\n");
	}

 	sysfs_create_file(&oduinoSensor->dev.kobj, &dev_attr_oduino_sensor.attr);	

	return 0;
	
}

static void __exit oduinoSensor_exit (void){

	sysfs_remove_file(&oduinoSensor->dev.kobj, &dev_attr_oduino_sensor.attr);
	platform_device_unregister(oduinoSensor);

	return;
}

module_init(oduinoSensor_init);
module_exit(oduinoSensor_exit);

MODULE_LICENSE("GPL");<commit_msg>oduino_senosor service complete<commit_after>#include <linux/module.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/sysfs.h>
#include <linux/device.h>

static int temp;
static int hum;
struct class *VsensorClass;
struct device *odev;

static ssize_t sensorShow(struct device *dev, struct device_attribute *attr, 
				char *buffer){
	return sprintf(buffer, "%d %d\n", temp, hum);
}

static ssize_t sensorStore(struct device *dev, struct device_attribute *attr, 
				const char *buffer, size_t count){
	sscanf(buffer, "%d %d", &temp, &hum);
	return count;
}

DEVICE_ATTR(oduino_sensor, 0777, sensorShow, sensorStore);


static int __init oduinoSensor_init(void){
	VsensorClass = class_create(THIS_MODULE, "Vsensor");
	odev = device_create(VsensorClass, NULL, 0, NULL, "oduino");
	//oduinoSensor = platform_device_register_simple("oduinoSensor", -1, NULL, 0);
	device_create_file(odev,  &dev_attr_oduino_sensor);
 //	sysfs_create_file(&oduinoSensor->dev.kobj, &dev_attr_oduino_sensor.attr);	

	return 0;
	
}

static void __exit oduinoSensor_exit (void){

//	sysfs_remove_file(&oduinoSensor->dev.kobj, &dev_attr_oduino_sensor.attr);
//	platform_device_unregister(oduinoSensor);
	device_destroy(VsensorClass, 0);
	class_destroy(VsensorClass);
	device_remove_file(odev, &dev_attr_oduino_sensor);
	return;
}

module_init(oduinoSensor_init);
module_exit(oduinoSensor_exit);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("virtual input device");
{'fraction_non_alphanumeric': 0.12584777694046723, 'fraction_numerical': 0.007535795026375283, 'mean_word_length': 6.7631578947368425, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '1405168', 'n_tokens_mistral': 1006, 'n_tokens_neox': 985, 'n_words': 198}