本文整理汇总了C++中device_create_file函数的典型用法代码示例。如果您正苦于以下问题:C++ device_create_file函数的具体用法?C++ device_create_file怎么用?C++ device_create_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了device_create_file函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: balong_sim_probe
//.........这里部分代码省略.........
/*request SIM irq*/
if (!strcmp(SIM1 , plat->name))
{
INIT_WORK(&sim1_irq_work, balong_sim1_set_status);
err = request_irq(gpio_to_irq(plat->sim_detection_gpio), sim1_detection_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND,
pdev->name, pdev);
if (err) {
dev_warn(&pdev->dev, "request gpio irq error\n");
goto no_sim_detect_irq;
}
#ifdef SIM_HPD
pr_info(" SIM1 sim_hpd_out_f [%d]\n", plat->sim_hpd_out_f);
pr_info(" SIM1 sim_hpd_in_f [%d]\n", plat->sim_hpd_in_f);
/*SIM HPD out irq request*/
err = request_irq(plat->sim_hpd_out_f, sim1_hpd_out_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND, pdev->name, pdev);
if (err) {
dev_warn(&pdev->dev, "request sim_hpd_out_f irq error\n");
goto no_sim_hpd_out_irq;
}
/*SIM HPD in irq request*/
err = request_irq(plat->sim_hpd_in_f, sim1_hpd_in_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND, pdev->name, pdev);
if (err) {
dev_warn(&pdev->dev, "request sim_hpd_in_f irq error\n");
goto no_sim_hpd_in_irq;
}
#endif
/* sysfs entries for IO control */
err = device_create_file(&(pdev->dev), &dev_attr_sim1_status);
if (err) {
dev_err(&pdev->dev, "Failed to create sysfs entry\n");
goto err_create_device_file;
}
}
if (!strcmp(SIM2 , plat->name))
{
INIT_WORK(&sim2_irq_work, balong_sim2_set_status);
err = request_irq(gpio_to_irq(plat->sim_detection_gpio), sim2_detection_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND,
pdev->name, pdev);
if (err) {
dev_warn(&pdev->dev, "request gpio irq error\n");
goto no_sim_detect_irq;
}
#ifdef SIM_HPD
pr_info(" SIM2 sim_hpd_out_f [%d]\n", plat->sim_hpd_out_f);
pr_info(" SIM2 sim_hpd_in_f [%d]\n", plat->sim_hpd_in_f);
/*SIM HPD out irq request*/
err = request_irq(plat->sim_hpd_out_f, sim2_hpd_out_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND, pdev->name, pdev);
if (err) {
dev_warn(&pdev->dev, "request sim_hpd_out_f irq error\n");
goto no_sim_hpd_out_irq;
}
/*SIM HPD in irq request*/
err = request_irq(plat->sim_hpd_in_f, sim2_hpd_in_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND, pdev->name, pdev);
if (err) {
dev_warn(&pdev->dev, "request sim_hpd_in_f irq error\n");
goto no_sim_hpd_in_irq;
}
#endif
/* sysfs entries for IO control */
err = device_create_file(&(pdev->dev), &dev_attr_sim2_status);
if (err) {
dev_err(&pdev->dev, "Failed to create sysfs entry\n");
goto err_create_device_file;
}
}
return 0;
err_create_device_file:
#ifdef SIM_HPD
if (!strcmp(SIM1 , plat->name)) free_irq(plat->sim_hpd_in_f, sim1_hpd_in_irq_handler);
if (!strcmp(SIM2 , plat->name)) free_irq(plat->sim_hpd_in_f, sim2_hpd_in_irq_handler);
no_sim_hpd_in_irq:
if (!strcmp(SIM1 , plat->name)) free_irq(plat->sim_hpd_out_f, sim1_hpd_out_irq_handler);
if (!strcmp(SIM2 , plat->name)) free_irq(plat->sim_hpd_out_f, sim2_hpd_out_irq_handler);
no_sim_hpd_out_irq:
#endif
if (!strcmp(SIM1 , plat->name)) free_irq(gpio_to_irq(plat->sim_detection_gpio), sim1_detection_irq_handler);
if (!strcmp(SIM2 , plat->name)) free_irq(gpio_to_irq(plat->sim_detection_gpio), sim2_detection_irq_handler);
no_sim_detect_irq:
destroy_workqueue(workqueue);
workqueue = NULL;
err_init_workqueue:
gpio_free(plat->sim_detection_gpio);
return err;
}
开发者ID:printusrzero,项目名称:hwp6s-kernel,代码行数:101,代码来源:balong_sim.c
示例2: mdnie_probe
static int mdnie_probe(struct platform_device *pdev)
{
#if defined(CONFIG_FB_MDNIE_PWM)
struct platform_mdnie_data *pdata = pdev->dev.platform_data;
#endif
struct mdnie_info *mdnie;
int ret = 0;
mdnie_class = class_create(THIS_MODULE, dev_name(&pdev->dev));
if (IS_ERR_OR_NULL(mdnie_class)) {
pr_err("failed to create mdnie class\n");
ret = -EINVAL;
goto error0;
}
mdnie_class->dev_attrs = mdnie_attributes;
mdnie = kzalloc(sizeof(struct mdnie_info), GFP_KERNEL);
if (!mdnie) {
pr_err("failed to allocate mdnie\n");
ret = -ENOMEM;
goto error1;
}
mdnie->dev = device_create(mdnie_class, &pdev->dev, 0, &mdnie, "mdnie");
if (IS_ERR_OR_NULL(mdnie->dev)) {
pr_err("failed to create mdnie device\n");
ret = -EINVAL;
goto error2;
}
#if defined(CONFIG_FB_MDNIE_PWM)
if (!pdata) {
pr_err("no platform data specified\n");
ret = -EINVAL;
goto error3;
}
mdnie->bd = backlight_device_register("panel", mdnie->dev,
mdnie, &mdnie_backlight_ops, NULL);
mdnie->bd->props.max_brightness = MAX_BRIGHTNESS_LEVEL;
mdnie->bd->props.brightness = DEFAULT_BRIGHTNESS;
mdnie->bd_enable = TRUE;
mdnie->lcd_pd = pdata->lcd_pd;
ret = device_create_file(&mdnie->bd->dev, &dev_attr_auto_brightness);
if (ret < 0)
dev_err(&mdnie->bd->dev, "failed to add sysfs entries, %d\n", __LINE__);
#endif
mdnie->scenario = UI_MODE;
mdnie->mode = STANDARD;
mdnie->enable = TRUE;
mdnie->tuning = FALSE;
mdnie->accessibility = ACCESSIBILITY_OFF;
mdnie->cabc = CABC_OFF;
#if defined(CONFIG_FB_MDNIE_PWM)
mdnie->power_lut_idx = LUT_LEVEL_MANUAL_AND_INDOOR;
mdnie->auto_brightness = 0;
#endif
mutex_init(&mdnie->lock);
mutex_init(&mdnie->dev_lock);
platform_set_drvdata(pdev, mdnie);
dev_set_drvdata(mdnie->dev, mdnie);
#ifdef CONFIG_HAS_EARLYSUSPEND
#if defined(CONFIG_FB_MDNIE_PWM)
mdnie->early_suspend.suspend = mdnie_early_suspend;
#endif
mdnie->early_suspend.resume = mdnie_late_resume;
mdnie->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB - 1;
register_early_suspend(&mdnie->early_suspend);
#endif
#if defined(CONFIG_FB_MDNIE_PWM)
dev_info(mdnie->dev, "lcdtype: %d\n", pdata->display_type);
if (pdata->display_type >= ARRAY_SIZE(backlight_table))
pdata->display_type = 0;
mdnie->backlight = &backlight_table[pdata->display_type];
#endif
#if defined(CONFIG_FB_S5P_S6F1202A)
if (pdata->display_type == 0)
memcpy(tuning_table, tuning_table_hydis, sizeof(tuning_table));
else if (pdata->display_type == 1)
memcpy(tuning_table, tuning_table_sec, sizeof(tuning_table));
else if (pdata->display_type == 2)
memcpy(tuning_table, tuning_table_boe, sizeof(tuning_table));
#endif
g_mdnie = mdnie;
mdnie_update(mdnie);
dev_info(mdnie->dev, "registered successfully\n");
//.........这里部分代码省略.........
开发者ID:rfcclub,项目名称:Googy-Max2-Kernel,代码行数:101,代码来源:mdnie.c
示例3: soc_pcmcia_add_one
int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt)
{
int ret;
skt->cs_state = dead_socket;
setup_timer(&skt->poll_timer, soc_common_pcmcia_poll_event,
(unsigned long)skt);
skt->poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD;
ret = request_resource(&iomem_resource, &skt->res_skt);
if (ret)
goto out_err_1;
ret = request_resource(&skt->res_skt, &skt->res_io);
if (ret)
goto out_err_2;
ret = request_resource(&skt->res_skt, &skt->res_mem);
if (ret)
goto out_err_3;
ret = request_resource(&skt->res_skt, &skt->res_attr);
if (ret)
goto out_err_4;
skt->virt_io = ioremap(skt->res_io.start, 0x10000);
if (skt->virt_io == NULL) {
ret = -ENOMEM;
goto out_err_5;
}
/*
* We initialize default socket timing here, because
* we are not guaranteed to see a SetIOMap operation at
* runtime.
*/
skt->ops->set_timing(skt);
ret = soc_pcmcia_hw_init(skt);
if (ret)
goto out_err_6;
skt->socket.ops = &soc_common_pcmcia_operations;
skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
skt->socket.resource_ops = &pccard_static_ops;
skt->socket.irq_mask = 0;
skt->socket.map_size = PAGE_SIZE;
skt->socket.io_offset = (unsigned long)skt->virt_io;
skt->status = soc_common_pcmcia_skt_state(skt);
#ifdef CONFIG_CPU_FREQ
if (skt->ops->frequency_change) {
skt->cpufreq_nb.notifier_call = soc_common_pcmcia_cpufreq_nb;
ret = cpufreq_register_notifier(&skt->cpufreq_nb,
CPUFREQ_TRANSITION_NOTIFIER);
if (ret < 0)
dev_err(skt->socket.dev.parent,
"unable to register CPU frequency change notifier for PCMCIA (%d)\n",
ret);
}
#endif
ret = pcmcia_register_socket(&skt->socket);
if (ret)
goto out_err_7;
ret = device_create_file(&skt->socket.dev, &dev_attr_status);
if (ret)
goto out_err_8;
return ret;
out_err_8:
del_timer_sync(&skt->poll_timer);
pcmcia_unregister_socket(&skt->socket);
out_err_7:
soc_pcmcia_hw_shutdown(skt);
out_err_6:
iounmap(skt->virt_io);
out_err_5:
release_resource(&skt->res_attr);
out_err_4:
release_resource(&skt->res_mem);
out_err_3:
release_resource(&skt->res_io);
out_err_2:
release_resource(&skt->res_skt);
out_err_1:
return ret;
}
开发者ID:acton393,项目名称:linux,代码行数:95,代码来源:soc_common.c
示例4: asus_oled_probe
static int asus_oled_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev(interface);
struct asus_oled_dev *odev = NULL;
int retval = -ENOMEM;
uint16_t dev_width = 0;
enum oled_pack_mode pack_mode = PACK_MODE_LAST;
const struct oled_dev_desc_str *dev_desc = oled_dev_desc_table;
const char *desc = NULL;
if (!id) {
/* Even possible? Just to make sure...*/
dev_err(&interface->dev, "No usb_device_id provided!\n");
return -ENODEV;
}
for (; dev_desc->idVendor; dev_desc++) {
if (dev_desc->idVendor == id->idVendor
&& dev_desc->idProduct == id->idProduct) {
dev_width = dev_desc->devWidth;
desc = dev_desc->devDesc;
pack_mode = dev_desc->packMode;
break;
}
}
if (!desc || dev_width < 1 || pack_mode == PACK_MODE_LAST) {
dev_err(&interface->dev,
"Missing or incomplete device description!\n");
return -ENODEV;
}
odev = kzalloc(sizeof(struct asus_oled_dev), GFP_KERNEL);
if (odev == NULL) {
dev_err(&interface->dev, "Out of memory\n");
return -ENOMEM;
}
odev->udev = usb_get_dev(udev);
odev->pic_mode = ASUS_OLED_STATIC;
odev->dev_width = dev_width;
odev->pack_mode = pack_mode;
odev->height = 0;
odev->width = 0;
odev->x_shift = 0;
odev->y_shift = 0;
odev->buf_offs = 0;
odev->buf_size = 0;
odev->last_val = 0;
odev->buf = NULL;
odev->enabled = 1;
odev->dev = NULL;
usb_set_intfdata(interface, odev);
retval = device_create_file(&interface->dev,
&ASUS_OLED_DEVICE_ATTR(enabled));
if (retval)
goto err_files;
retval = device_create_file(&interface->dev,
&ASUS_OLED_DEVICE_ATTR(picture));
if (retval)
goto err_files;
odev->dev = device_create(oled_class, &interface->dev, MKDEV(0, 0),
NULL, "oled_%d", ++oled_num);
if (IS_ERR(odev->dev)) {
retval = PTR_ERR(odev->dev);
goto err_files;
}
dev_set_drvdata(odev->dev, odev);
retval = device_create_file(odev->dev, &dev_attr_enabled);
if (retval)
goto err_class_enabled;
retval = device_create_file(odev->dev, &dev_attr_picture);
if (retval)
goto err_class_picture;
dev_info(&interface->dev,
"Attached Asus OLED device: %s [width %u, pack_mode %d]\n",
desc, odev->dev_width, odev->pack_mode);
if (start_off)
enable_oled(odev, 0);
return 0;
err_class_picture:
device_remove_file(odev->dev, &dev_attr_picture);
err_class_enabled:
device_remove_file(odev->dev, &dev_attr_enabled);
device_unregister(odev->dev);
//.........这里部分代码省略.........
开发者ID:AdiPat,项目名称:android_kernel_tegra_n1,代码行数:101,代码来源:asus_oled.c
示例5: gpio_event_probe
static int gpio_event_probe(struct platform_device *pdev)
{
int err;
struct gpio_event *ip;
struct gpio_event_platform_data *event_info;
int dev_count = 1;
int i;
int registered = 0;
event_info = pdev->dev.platform_data;
if (event_info == NULL) {
pr_err("gpio_event_probe: No pdata\n");
return -ENODEV;
}
if ((!event_info->name && !event_info->names[0]) ||
!event_info->info || !event_info->info_count) {
pr_err("gpio_event_probe: Incomplete pdata\n");
return -ENODEV;
}
if (!event_info->name)
while (event_info->names[dev_count])
dev_count++;
ip = kzalloc(sizeof(*ip) +
sizeof(ip->state[0]) * event_info->info_count +
sizeof(*ip->input_devs) +
sizeof(ip->input_devs->dev[0]) * dev_count, GFP_KERNEL);
if (ip == NULL) {
err = -ENOMEM;
pr_err("gpio_event_probe: Failed to allocate private data\n");
goto err_kp_alloc_failed;
}
ip->input_devs = (void*)&ip->state[event_info->info_count];
platform_set_drvdata(pdev, ip);
for (i = 0; i < dev_count; i++) {
struct input_dev *input_dev = input_allocate_device();
if (input_dev == NULL) {
err = -ENOMEM;
pr_err("gpio_event_probe: "
"Failed to allocate input device\n");
goto err_input_dev_alloc_failed;
}
input_set_drvdata(input_dev, ip);
input_dev->name = event_info->name ?
event_info->name : event_info->names[i];
input_dev->event = gpio_input_event;
ip->input_devs->dev[i] = input_dev;
}
ip->input_devs->count = dev_count;
ip->info = event_info;
if (event_info->power) {
#ifdef CONFIG_HAS_EARLYSUSPEND
ip->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
ip->early_suspend.suspend = gpio_event_suspend;
ip->early_suspend.resume = gpio_event_resume;
register_early_suspend(&ip->early_suspend);
#endif
ip->info->power(ip->info, 1);
}
err = gpio_event_call_all_func(ip, GPIO_EVENT_FUNC_INIT);
if (err)
goto err_call_all_func_failed;
for (i = 0; i < dev_count; i++) {
err = input_register_device(ip->input_devs->dev[i]);
if (err) {
pr_err("gpio_event_probe: Unable to register %s "
"input device\n", ip->input_devs->dev[i]->name);
goto err_input_register_device_failed;
}
registered++;
}
#if defined(CONFIG_MACH_KYLE) || defined(CONFIG_MACH_AMAZING)
err = device_create_file(&(pdev->dev), &dev_attr_wakeup_keys);
#endif
return 0;
err_input_register_device_failed:
gpio_event_call_all_func(ip, GPIO_EVENT_FUNC_UNINIT);
err_call_all_func_failed:
if (event_info->power) {
#ifdef CONFIG_HAS_EARLYSUSPEND
unregister_early_suspend(&ip->early_suspend);
#endif
ip->info->power(ip->info, 0);
}
for (i = 0; i < registered; i++)
input_unregister_device(ip->input_devs->dev[i]);
for (i = dev_count - 1; i >= registered; i--) {
input_free_device(ip->input_devs->dev[i]);
err_input_dev_alloc_failed:
;
}
kfree(ip);
err_kp_alloc_failed:
return err;
}
开发者ID:FrozenCow,项目名称:kyleopen-kernel,代码行数:98,代码来源:gpio_event.c
示例6: lp8556_probe
//.........这里部分代码省略.........
led_data->regulator = regulator_get(&client->dev,
LP8556_REGULATOR_NAME);
if (IS_ERR(led_data->regulator))
pr_err("%s: regulator_get(\"%s\"): -1\n",
__func__, LP8556_REGULATOR_NAME);
else {
error = regulator_set_voltage(led_data->regulator,
LP8556_VDD_MIN_VOLTAGE, LP8556_VDD_MAX_VOLTAGE);
if (error != 0)
pr_err("%s: regulator_set_voltage(%d:%d):%d\n",
__func__, LP8556_VDD_MIN_VOLTAGE,
LP8556_VDD_MAX_VOLTAGE, error);
error = regulator_enable(led_data->regulator);
if (error != 0)
pr_err("%s: regulator_enable(\"%s\"):%d\n", __func__,
LP8556_REGULATOR_NAME, error);
}
error = lp8556_gpio_init(pdata);
if (error) {
pr_err("%s: gpio_init failure\n", __func__);
goto err_gpio_init;
}
error = gpio_export_link(&led_data->client->dev, "reset",
led_data->pdata->enable_gpio);
if (error < 0) {
pr_err("%s: failed to export link %s for gpio %d, err = %d\n",
__func__, "reset", led_data->pdata->enable_gpio, error);
goto err_gpio_export_link;
}
lp8556_enable(led_data, true);
error = lp8556_init_registers(led_data);
if (error < 0) {
pr_err("%s: Register Initialization failed: %d\n",
__func__, error);
error = -ENODEV;
goto err_reg_init_failed;
}
atomic_set(&led_data->enabled, 1);
error = led_classdev_register((struct device *) &client->dev,
&led_data->led_dev);
if (error < 0) {
pr_err("%s: Register led class failed: %d\n", __func__, error);
error = -ENODEV;
goto err_classdev_failed;
}
led_data->bl_dev = backlight_device_register(LCD_BACKLIGHT,
&client->dev, led_data, &lp8556_bl_ops, NULL);
if (IS_ERR(led_data->bl_dev)) {
error = PTR_ERR(led_data->bl_dev);
pr_err("%s: backlight_device_register: %d\n", __func__, error);
goto err_bl_device_register;
}
led_data->bl_dev->props.max_brightness = LP8556_MAX_BRIGHTNESS;
led_data->led_dev.brightness = led_data->pdata->power_up_brightness;
led_data->bl_dev->props.brightness = led_data->led_dev.brightness;
#ifdef CONFIG_HAS_EARLYSUSPEND
led_data->early_suspender.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;
led_data->early_suspender.suspend = lp8556_early_suspend;
led_data->early_suspender.resume = lp8556_late_resume,
register_early_suspend(&led_data->early_suspender);
#endif
#ifdef DEBUG
error = device_create_file(led_data->led_dev.dev, &dev_attr_registers);
if (error < 0)
pr_err("%s: File device creation failed: %d\n",
__func__, error);
#endif
pr_debug("Backlight driver initialized\n");
return 0;
err_bl_device_register:
led_classdev_unregister(&led_data->led_dev);
err_classdev_failed:
err_reg_init_failed:
lp8556_enable(led_data, false);
err_gpio_export_link:
gpio_free(led_data->pdata->enable_gpio);
err_gpio_init:
if (!IS_ERR(led_data->regulator)) {
regulator_disable(led_data->regulator);
regulator_put(led_data->regulator);
}
kfree(led_data);
i2c_set_clientdata(client, NULL);
err_alloc_data_failed:
return error;
}
开发者ID:itsmerajit,项目名称:kernel_otus,代码行数:101,代码来源:lp8556.c
示例7: s3cfb_probe
//.........这里部分代码省略.........
dev_err(ctrl->dev, "failed to get fimd clock source\n");
ret = -EINVAL;
goto err_clk;
}
clk_enable(ctrl->clock);
/* io memory */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(ctrl->dev, "failed to get io memory region\n");
ret = -EINVAL;
goto err_io;
}
/* request mem region */
res = request_mem_region(res->start,
res->end - res->start + 1, pdev->name);
if (!res) {
dev_err(ctrl->dev, "failed to request io memory region\n");
ret = -EINVAL;
goto err_io;
}
/* ioremap for register block */
ctrl->regs = ioremap(res->start, res->end - res->start + 1);
if (!ctrl->regs) {
dev_err(ctrl->dev, "failed to remap io region\n");
ret = -EINVAL;
goto err_io;
}
/* irq */
ctrl->irq = platform_get_irq(pdev, 0);
if (request_irq(ctrl->irq, s3cfb_irq_frame, IRQF_DISABLED,
pdev->name, ctrl)) {
dev_err(ctrl->dev, "request_irq failed\n");
ret = -EINVAL;
goto err_irq;
}
#ifdef CONFIG_FB_S3C_V2_TRACE_UNDERRUN
if (request_irq(platform_get_irq(pdev, 1), s3cfb_irq_fifo,
IRQF_DISABLED, pdev->name, ctrl)) {
dev_err(ctrl->dev, "request_irq failed\n");
ret = -EINVAL;
goto err_irq;
}
s3cfb_set_fifo_interrupt(ctrl, 1);
dev_info(ctrl->dev, "fifo underrun trace\n");
#endif
/* init global */
s3cfb_init_global();
s3cfb_display_on(ctrl);
/* panel control */
if (pdata->backlight_on)
pdata->backlight_on(pdev);
if (pdata->lcd_on)
pdata->lcd_on(pdev);
if (ctrl->lcd->init_ldi)
ctrl->lcd->init_ldi();
/* prepare memory */
if (s3cfb_alloc_framebuffer())
goto err_alloc;
if (s3cfb_register_framebuffer())
goto err_alloc;
s3cfb_set_clock(ctrl);
s3cfb_enable_window(pdata->default_win);
ret = device_create_file(&(pdev->dev), &dev_attr_win_power);
if (ret < 0)
dev_err(ctrl->dev, "failed to add sysfs entries\n");
dev_info(ctrl->dev, "registered successfully\n");
return 0;
err_alloc:
free_irq(ctrl->irq, ctrl);
err_irq:
iounmap(ctrl->regs);
err_io:
clk_disable(ctrl->clock);
err_clk:
clk_put(ctrl->clock);
err_global:
return ret;
}
开发者ID:FrozenData,项目名称:SGS2-Kernel-Update2,代码行数:101,代码来源:s3cfb2.c
示例8: ehci_rkhsic_probe
static int ehci_rkhsic_probe(struct platform_device *pdev)
{
struct usb_hcd *hcd;
struct ehci_hcd *ehci;
struct resource *res;
struct device *dev = &pdev->dev;
struct rkehci_platform_data *pldata;
int ret;
int retval = 0;
static u64 usb_dmamask = 0xffffffffUL;
struct device_node *node = pdev->dev.of_node;
struct rkehci_pdata_id *p;
const struct of_device_id *match =
of_match_device(of_match_ptr(rk_hsic_of_match), &pdev->dev);
dev_dbg(&pdev->dev, "ehci_rkhsic proble\n");
if (match) {
p = (struct rkehci_pdata_id *)match->data;
} else {
dev_err(dev, "ehci_rkhsic match failed\n");
return -EINVAL;
}
dev->platform_data = p->pdata;
pldata = dev->platform_data;
pldata->dev = dev;
if (!node) {
dev_err(dev, "device node not found\n");
return -EINVAL;
}
dev->dma_mask = &usb_dmamask;
retval = device_create_file(dev, &dev_attr_ehci_rkhsic_power);
retval = device_create_file(dev, &dev_attr_hsic_debug_ehci);
hcd = usb_create_hcd(&rk_hsic_driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
dev_err(&pdev->dev, "Unable to create HCD\n");
return -ENOMEM;
}
if (pldata->hw_init)
pldata->hw_init();
if (pldata->clock_init) {
pldata->clock_init(pldata);
pldata->clock_enable(pldata, 1);
}
if (pldata->soft_reset)
pldata->soft_reset(pldata, RST_POR);;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Unable to get memory resource\n");
ret = -ENODEV;
goto put_hcd;
}
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
hcd->regs = devm_ioremap_resource(dev, res);
if (!hcd->regs) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto put_hcd;
}
hcd->irq = platform_get_irq(pdev, 0);
if (hcd->irq < 0) {
dev_err(&pdev->dev, "Unable to get IRQ resource\n");
ret = hcd->irq;
goto put_hcd;
}
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs;
ehci->regs = hcd->regs + 0x10;
printk("%s %p %p\n", __func__, ehci->caps, ehci->regs);
dbg_hcs_params(ehci, "reset");
dbg_hcc_params(ehci, "reset");
ehci->hcs_params = readl(&ehci->caps->hcs_params);
ret = usb_add_hcd(hcd, hcd->irq, IRQF_DISABLED | IRQF_SHARED);
if (ret) {
dev_err(&pdev->dev, "Failed to add USB HCD\n");
goto put_hcd;
}
g_hsic_ehci = ehci;
ehci_rkhsic_port_power(ehci, 1);
writel_relaxed(1, hcd->regs + 0xb0);
writel_relaxed(0x1d4d, hcd->regs + 0x90);
writel_relaxed(0x4, hcd->regs + 0xa0);
dsb();
//.........这里部分代码省略.........
开发者ID:lgeek,项目名称:linux-tronsmart-orion-r28,代码行数:101,代码来源:ehci-rkhsic.c
示例9: create_ehci_sys_file
static inline int create_ehci_sys_file(struct ehci_hcd *ehci)
{
return device_create_file(ehci_to_hcd(ehci)->self.controller,
&dev_attr_ehci_power);
}
开发者ID:dangordon1212,项目名称:sgs4duos_kernel,代码行数:5,代码来源:ehci-s5p.c
示例10: s5p_fimd_lite_probe
static int s5p_fimd_lite_probe(struct s5p_fimd_ext_device *fx_dev)
{
struct clk *sclk = NULL;
struct resource *res;
struct s5p_fimd_lite *fimd_lite;
int ret = -1;
#ifdef CONFIG_SLP_DISP_DEBUG
int i;
#endif
fimd_lite = kzalloc(sizeof(struct s5p_fimd_lite), GFP_KERNEL);
if (!fimd_lite) {
dev_err(&fx_dev->dev, "failed to alloc fimd_lite object.\n");
return -EFAULT;
}
fimd_lite->dev = &fx_dev->dev;
fimd_lite->lcd = (struct exynos_drm_fimd_pdata *)
to_fimd_lite_platform_data(fx_dev);
res = s5p_fimd_ext_get_resource(fx_dev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&fx_dev->dev, "failed to get io memory region.\n");
ret = -EINVAL;
goto err0;
}
fimd_lite->iomem_base = ioremap(res->start, resource_size(res));
if (!fimd_lite->iomem_base) {
dev_err(&fx_dev->dev, "failed to remap io region\n");
ret = -EFAULT;
goto err0;
}
fimd_lite->clk = clk_get(&fx_dev->dev, "mdnie0");
if (IS_ERR(fimd_lite->clk)) {
dev_err(&fx_dev->dev, "failed to get FIMD LITE clock source\n");
ret = -EINVAL;
goto err1;
}
sclk = clk_get(&fx_dev->dev, "sclk_mdnie");
if (IS_ERR(sclk)) {
dev_err(&fx_dev->dev, "failed to get sclk_mdnie clock\n");
ret = -EINVAL;
goto err2;
}
fimd_lite->clk->parent = sclk;
fimd_lite->irq = s5p_fimd_ext_get_irq(fx_dev, 0);
/* register interrupt handler for fimd-lite. */
if (request_irq(fimd_lite->irq, s5p_fimd_lite_irq_frame, IRQF_DISABLED,
fx_dev->name, (void *)fimd_lite)) {
dev_err(&fx_dev->dev, "request_irq failed\n");
ret = -EINVAL;
goto err3;
}
#ifdef CONFIG_SLP_DISP_DEBUG
for (i = 0; i < ARRAY_SIZE(device_attrs); i++) {
ret = device_create_file(&(fx_dev->dev),
&device_attrs[i]);
if (ret)
break;
}
if (ret < 0)
dev_err(&fx_dev->dev, "failed to add sysfs entries\n");
#endif
fimd_ext_set_drvdata(fx_dev, fimd_lite);
dev_info(&fx_dev->dev, "fimd lite driver has been probed.\n");
return 0;
err3:
free_irq(fimd_lite->irq, fx_dev);
err2:
clk_put(sclk);
err1:
iounmap(fimd_lite->iomem_base);
clk_put(fimd_lite->clk);
err0:
kfree(fimd_lite);
return ret;
}
开发者ID:perillamint,项目名称:tizen-linux-3.0,代码行数:90,代码来源:s5p_fimd_lite.c
示例11: msm_vidc_probe
static int __devinit msm_vidc_probe(struct platform_device *pdev)
{
int rc = 0;
struct msm_vidc_core *core;
struct device *dev;
int nr = BASE_DEVICE_NUMBER;
core = kzalloc(sizeof(*core), GFP_KERNEL);
if (!core || !vidc_driver) {
dprintk(VIDC_ERR,
"Failed to allocate memory for device core\n");
rc = -ENOMEM;
goto err_no_mem;
}
rc = msm_vidc_initialize_core(pdev, core);
if (rc) {
dprintk(VIDC_ERR, "Failed to init core\n");
goto err_core_init;
}
rc = device_create_file(&pdev->dev, &dev_attr_pwr_collapse_delay);
if (rc) {
dprintk(VIDC_ERR,
"Failed to create pwr_collapse_delay sysfs node");
goto err_core_init;
}
if (core->hfi_type == VIDC_HFI_Q6) {
dprintk(VIDC_ERR, "Q6 hfi device probe called\n");
nr += MSM_VIDC_MAX_DEVICES;
core->id = MSM_VIDC_CORE_Q6;
} else {
core->id = MSM_VIDC_CORE_VENUS;
}
rc = v4l2_device_register(&pdev->dev, &core->v4l2_dev);
if (rc) {
dprintk(VIDC_ERR, "Failed to register v4l2 device\n");
goto err_v4l2_register;
}
core->vdev[MSM_VIDC_DECODER].vdev.release =
msm_vidc_release_video_device;
core->vdev[MSM_VIDC_DECODER].vdev.fops = &msm_v4l2_vidc_fops;
core->vdev[MSM_VIDC_DECODER].vdev.ioctl_ops = &msm_v4l2_ioctl_ops;
core->vdev[MSM_VIDC_DECODER].type = MSM_VIDC_DECODER;
rc = video_register_device(&core->vdev[MSM_VIDC_DECODER].vdev,
VFL_TYPE_GRABBER, nr);
if (rc) {
dprintk(VIDC_ERR, "Failed to register video decoder device");
goto err_dec_register;
}
video_set_drvdata(&core->vdev[MSM_VIDC_DECODER].vdev, core);
dev = &core->vdev[MSM_VIDC_DECODER].vdev.dev;
rc = device_create_file(dev, &dev_attr_link_name);
if (rc) {
dprintk(VIDC_ERR,
"Failed to create link name sysfs for decoder");
goto err_dec_attr_link_name;
}
core->vdev[MSM_VIDC_ENCODER].vdev.release =
msm_vidc_release_video_device;
core->vdev[MSM_VIDC_ENCODER].vdev.fops = &msm_v4l2_vidc_fops;
core->vdev[MSM_VIDC_ENCODER].vdev.ioctl_ops = &msm_v4l2_ioctl_ops;
core->vdev[MSM_VIDC_ENCODER].type = MSM_VIDC_ENCODER;
rc = video_register_device(&core->vdev[MSM_VIDC_ENCODER].vdev,
VFL_TYPE_GRABBER, nr + 1);
if (rc) {
dprintk(VIDC_ERR, "Failed to register video encoder device");
goto err_enc_register;
}
video_set_drvdata(&core->vdev[MSM_VIDC_ENCODER].vdev, core);
dev = &core->vdev[MSM_VIDC_ENCODER].vdev.dev;
rc = device_create_file(dev, &dev_attr_link_name);
if (rc) {
dprintk(VIDC_ERR,
"Failed to create link name sysfs for encoder");
goto err_enc_attr_link_name;
}
mutex_lock(&vidc_driver->lock);
if (vidc_driver->num_cores + 1 > MSM_VIDC_CORES_MAX) {
mutex_unlock(&vidc_driver->lock);
dprintk(VIDC_ERR, "Maximum cores already exist, core_no = %d\n",
vidc_driver->num_cores);
goto err_cores_exceeded;
}
vidc_driver->num_cores++;
mutex_unlock(&vidc_driver->lock);
core->device = vidc_hfi_initialize(core->hfi_type, core->id,
&core->resources, &handle_cmd_response);
if (IS_ERR_OR_NULL(core->device)) {
mutex_lock(&vidc_driver->lock);
vidc_driver->num_cores--;
mutex_unlock(&vidc_driver->lock);
rc = PTR_ERR(core->device);
if (rc != -EPROBE_DEFER)
dprintk(VIDC_ERR, "Failed to create HFI device\n");
else
dprintk(VIDC_DBG, "msm_vidc: request probe defer\n");
goto err_cores_exceeded;
//.........这里部分代码省略.........
开发者ID:CM11MOD,项目名称:android_kernel_pantech_ef60s,代码行数:101,代码来源:msm_v4l2_vidc.c
示例12: irled_init
static int __init irled_init(void)
{
int ret;
struct device *irled_dev;
ir_data.cpu_frequency = CLOCK_VALUE;
ir_data.on_offset = ON_OFFSET_VALUE;
ir_data.off_offset = OFF_OFFSET_VALUE;
INIT_WORK(&ir_data.work, irled_work);
irled_dev = device_create(sec_class, NULL, 0, &ir_data, "sec_ir");
if (unlikely(IS_ERR(irled_dev))) {
pr_err("irled: failed create irled device\n");
goto err_create_dev;
}
ret = device_create_file(irled_dev, &dev_attr_ir_send);
if (unlikely(ret < 0)) {
pr_err("irled: failed create device file\n");
goto err_create_dev_file1;
}
ret = device_create_file(irled_dev, &dev_attr_check_ir);
if (unlikely(ret < 0)) {
pr_err("irled: failed create device file\n");
goto err_create_dev_file2;
}
ret = device_create_file(irled_dev, &dev_attr_clock);
if (unlikely(ret < 0)) {
pr_err("irled: failed create device file\n");
goto err_create_dev_file3;
}
ret = device_create_file(irled_dev, &dev_attr_on_offset);
if (unlikely(ret < 0)) {
pr_err("irled: failed create device file\n");
goto err_create_dev_file4;
}
ret = device_create_file(irled_dev, &dev_attr_off_offset);
if (unlikely(ret < 0)) {
pr_err("irled: failed create device file\n");
goto err_create_dev_file5;
}
return 0;
err_create_dev_file5:
device_remove_file(irled_dev, &dev_attr_on_offset);
err_create_dev_file4:
device_remove_file(irled_dev, &dev_attr_clock);
err_create_dev_file3:
device_remove_file(irled_dev, &dev_attr_check_ir);
err_create_dev_file2:
device_remove_file(irled_dev, &dev_attr_ir_send);
err_create_dev_file1:
device_destroy(sec_class, irled_dev->devt);
err_create_dev:
return -1;
}
开发者ID:BobZhome,项目名称:gt-p3113-kernel,代码行数:63,代码来源:board-espresso10-irled.c
示例13: pn544_probe
static int pn544_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret = -ENODEV;
struct pn544_i2c_platform_data *platform_data;
struct pn544_dev *pn544_dev;
pr_debug("%s : Probing pn544 driver\n", __func__);
if (client->dev.of_node)
platform_data = pn544_of_init(client);
else
platform_data = client->dev.platform_data;
if (!platform_data) {
pr_err("%s : GPIO has value 0, nfc probe fail.\n", __func__);
goto err_exit;
}
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
pr_err("%s : i2c_check_functionality I2C_FUNC_I2C failed.\n",
__func__);
goto err_exit;
}
pn544_dev = kzalloc(sizeof(*pn544_dev), GFP_KERNEL);
if (pn544_dev == NULL) {
dev_err(&client->dev,
"failed to allocate memory for module data\n");
ret = -ENOMEM;
goto err_exit;
}
ret = pn544_gpio_init(platform_data);
if (ret) {
dev_err(&client->dev, "gpio init failed\n");
goto err_gpio_init;
}
pn544_dev->irq_gpio = platform_data->irq_gpio;
pn544_dev->ven_gpio = platform_data->ven_gpio;
pn544_dev->firmware_gpio = platform_data->firmware_gpio;
pn544_dev->ven_polarity = platform_data->ven_polarity;
pn544_dev->discharge_delay = platform_data->discharge_delay;
pn544_dev->client = client;
wake_lock_init(&pn544_dev->wakelock, WAKE_LOCK_SUSPEND, "pn544c3");
/* init mutex and queues */
init_waitqueue_head(&pn544_dev->read_wq);
mutex_init(&pn544_dev->read_mutex);
mutex_init(&pn544_dev->ioctl_mutex);
spin_lock_init(&pn544_dev->irq_enabled_lock);
pn544_dev->pn544_device.minor = MISC_DYNAMIC_MINOR;
pn544_dev->pn544_device.name = "pn544";
pn544_dev->pn544_device.fops = &pn544_dev_fops;
ret = misc_register(&pn544_dev->pn544_device);
if (ret) {
pr_err("%s : misc_register failed.\n", __FILE__);
goto err_misc_register;
}
pr_debug("%s : PN544 Misc Minor: %d\n",
__func__, pn544_dev->pn544_device.minor);
/* Get the device structure */
pn544_dev->pn544_control_device = pn544_dev->pn544_device.this_device;
/* Create sysfs device for PN544 control functionality */
ret = device_create_file(pn544_dev->pn544_control_device,
&dev_attr_pn544_control_dev);
if (ret) {
pr_err("%s : device_create_file failed\n", __FILE__);
goto err_device_create_file_failed;
}
/* request irq. the irq is set whenever the chip has data available
* for reading. it is cleared when all data has been read.
*/
pr_debug("%s : requesting IRQ %d\n", __func__, client->irq);
pn544_dev->irq_enabled = true;
ret = request_irq(client->irq, pn544_dev_irq_handler,
IRQF_TRIGGER_HIGH, client->name, pn544_dev);
if (ret) {
dev_err(&client->dev, "request_irq failed\n");
goto err_request_irq_failed;
}
if (unlikely(irq_set_irq_wake(client->irq, 1)))
pr_err("%s : unable to make irq %d wakeup\n", __func__,
client->irq);
pn544_disable_irq(pn544_dev);
pn544_dev->reboot_notify.notifier_call = nfc_blk_reboot_notify;
register_reboot_notifier(&pn544_dev->reboot_notify);
i2c_set_clientdata(client, pn544_dev);
return 0;
err_request_irq_failed:
//.........这里部分代码省略.........
开发者ID:gustavosss,项目名称:android_kernel_motorola_ghost,代码行数:101,代码来源:pn544-mot.c
示例14: ccwgroup_create
/*
* try to add a new ccwgroup device for one driver
* argc and argv[] are a list of bus_id's of devices
* belonging to the driver.
*/
int
ccwgroup_create(struct device *root,
unsigned int creator_id,
struct ccw_driver *cdrv,
int argc, char *argv[])
{
struct ccwgroup_device *gdev;
int i;
int rc;
if (argc > 256) /* disallow dumb users */
return -EINVAL;
gdev = kzalloc(sizeof(*gdev) + argc*sizeof(gdev->cdev[0]), GFP_KERNEL);
if (!gdev)
return -ENOMEM;
atomic_set(&gdev->onoff, 0);
for (i = 0; i < argc; i++) {
gdev->cdev[i] = get_ccwdev_by_busid(cdrv, argv[i]);
/* all devices have to be of the same type in
* order to be grouped */
if (!gdev->cdev[i]
|| gdev->cdev[i]->id.driver_info !=
gdev->cdev[0]->id.driver_info) {
rc = -EINVAL;
goto free_dev;
}
/* Don't allow a device to belong to more than one group. */
if (gdev->cdev[i]->dev.driver_data) {
rc = -EINVAL;
goto free_dev;
}
gdev->cdev[i]->dev.driver_data = gdev;
}
gdev->creator_id = creator_id;
gdev->count = argc;
gdev->dev.bus = &ccwgroup_bus_type;
gdev->dev.parent = root;
gdev->dev.release = ccwgroup_release;
snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s",
gdev->cdev[0]->dev.bus_id);
rc = device_register(&gdev->dev);
if (rc)
goto free_dev;
get_device(&gdev->dev);
rc = device_create_file(&gdev->dev, &dev_attr_ungroup);
if (rc) {
device_unregister(&gdev->dev);
goto error;
}
rc = __ccwgroup_create_symlinks(gdev);
if (!rc) {
put_device(&gdev->dev);
return 0;
}
device_remove_file(&gdev->dev, &dev_attr_ungroup);
device_unregister(&gdev->dev);
error:
for (i = 0; i < argc; i++)
if (gdev->cdev[i]) {
put_device(&gdev->cdev[i]->dev);
gdev->cdev[i]->dev.driver_data = NULL;
}
put_device(&gdev->dev);
return rc;
free_dev:
for (i = 0; i < argc; i++)
if (gdev->cdev[i]) {
if (gdev->cdev[i]->dev.driver_data == gdev)
gdev->cdev[i]->dev.driver_data = NULL;
put_device(&gdev->cdev[i]->dev);
}
kfree(gdev);
return rc;
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:89,代码来源:ccwgroup.c
示例15: dwc_otg_attr_create
/**
* Create the device files
*/
void dwc_otg_attr_create (struct lm_device *lmdev)
{
int error;
error = device_create_file(&lmdev->dev, &dev_attr_regoffset);
error = device_create_file(&lmdev->dev, &dev_attr_regvalue);
error = device_create_file(&lmdev->dev, &dev_attr_mode);
error = device_create_file(&lmdev->dev, &dev_attr_hnpcapable);
error = device_create_file(&lmdev->dev, &dev_attr_srpcapable);
error = device_create_file(&lmdev->dev, &dev_attr_hnp);
error = device_create_file(&lmdev->dev, &dev_attr_srp);
error = device_create_file(&lmdev->dev, &dev_attr_buspower);
error = device_create_file(&lmdev->dev, &dev_attr_bussuspend);
error = device_create_file(&lmdev->dev, &dev_attr_busconnected);
error = device_create_file(&lmdev->dev, &dev_attr_gotgctl);
error = device_create_file(&lmdev->dev, &dev_attr_gusbcfg);
error = device_create_file(&lmdev->dev, &dev_attr_grxfsiz);
error = device_create_file(&lmdev->dev, &dev_attr_gnptxfsiz);
error = device_create_file(&lmdev->dev, &dev_attr_gpvndctl);
error = device_create_file(&lmdev->dev, &dev_attr_ggpio);
error = device_create_file(&lmdev->dev, &dev_attr_guid);
error = device_create_file(&lmdev->dev, &dev_attr_gsnpsid);
error = device_create_file(&lmdev->dev, &dev_attr_devspeed);
error = device_create_file(&lmdev->dev, &dev_attr_enumspeed);
error = device_create_file(&lmdev->dev, &dev_attr_hptxfsiz);
error = device_create_file(&lmdev->dev, &dev_attr_hprt0);
error = device_create_file(&lmdev->dev, &dev_attr_remote_wakeup);
error = device_create_file(&lmdev->dev, &dev_attr_regdump);
error = device_create_file(&lmdev->dev, &dev_attr_spramdump);
error = device_create_file(&lmdev->dev, &dev_attr_hcddump);
error = device_create_file(&lmdev->dev, &dev_attr_hcd_frrem);
error = device_create_file(&lmdev->dev, &dev_attr_rd_reg_test);
error = device_create_file(&lmdev->dev, &dev_attr_wr_reg_test);
}
开发者ID:Februar0218,项目名称:openwrt-mt7620-1,代码行数:37,代码来源:dwc_otg_attr.c
示例16: touchkey_init
static int __init touchkey_init(void)
{
int ret = 0;
u8 updated = 0;
if ((ret = gpio_request(_3_GPIO_TOUCH_EN, "_3_GPIO_TOUCH_EN")))
printk(KERN_ERR "Failed to request gpio %s:%d\n", __func__, __LINE__);
// if (ret = gpio_request(_3_GPIO_TOUCH_INT, "_3_GPIO_TOUCH_INT"))
// printk(KERN_ERR "Failed to request gpio %s:%d\n", __func__, __LINE__);
ret = misc_register(&touchkey_update_device);
if (ret) {
printk(KERN_ERR "%s misc_register fail\n",__FUNCTION__);
}
if (device_create_file(touchkey_update_device.this_device, &dev_attr_touchkey_activation) < 0)
{
printk(KERN_ERR "%s device_create_file fail dev_attr_touchkey_activation\n",__FUNCTION__);
pr_err("Failed to create device file(%s)!\n", dev_attr_touchkey_activation.attr.name);
}
if (device_create_file(touchkey_update_device.this_device, &dev_attr_touchkey_version) < 0)
{
printk(KERN_ERR "%s device_create_file fail dev_attr_touchkey_version\n",__FUNCTION__);
pr_err("Failed to create device file(%s)!\n", dev_attr_touchkey_version.attr.name);
}
if (device_create_file(touchkey_update_device.this_device, &dev_attr_touchkey_recommend) < 0)
{
printk(KERN_ERR "%s device_create_file fail dev_attr_touchkey_recommend\n",__FUNCTION__);
pr_err("Failed to create device file(%s)!\n", dev_attr_touchkey_recommend.attr.name);
}
if (device_create_file(touchkey_update_device.this_device, &dev_attr_touchkey_firmup) < 0)
{
printk(KERN_ERR "%s device_create_file fail dev_attr_touchkey_firmup\n",__FUNCTION__);
pr_err("Failed to create device file(%s)!\n", dev_attr_touchkey_firmup.attr.name);
}
if (device_create_file(touchkey_update_device.this_device, &dev_attr_touchkey_init) < 0)
{
printk(KERN_ERR "%s device_create_file fail dev_attr_touchkey_init\n",__FUNCTION__);
pr_err("Failed to create device file(%s)!\n", dev_attr_touchkey_init.attr.name);
}
if (device_create_file(touchkey_update_device.this_device, &dev_attr_touchkey_menu) < 0)
{
printk(KERN_ERR "%s device_create_file fail dev_attr_touchkey_menu\n",__FUNCTION__);
pr_err("Failed to create device file(%s)!\n", dev_attr_t
|
请发表评论