Exemplo n.º 1
0
void bus_remove_driver(struct device_driver * drv)
{
	if (drv->bus) {
		driver_remove_file(drv, &driver_attr_bind);
		driver_remove_file(drv, &driver_attr_unbind);
		driver_remove_attrs(drv->bus, drv);
		klist_remove(&drv->knode_bus);
		pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
		driver_detach(drv);
		module_remove_driver(drv);
		kobject_unregister(&drv->kobj);
		put_bus(drv->bus);
	}
}
Exemplo n.º 2
0
static int __devexit imx_3stack_ak4647_remove(struct platform_device *pdev)
{
	struct mxc_audio_platform_data *dev_data = pdev->dev.platform_data;
	free_irq(dev_data->intr_id_hp, NULL);
	driver_remove_file(pdev->dev.driver, &driver_attr_headphone);
	return 0;
}
static int  dma_memcpy_remove(struct platform_device *pdev)
{
    int ret;
    driver_remove_file(&pdev->dev, &driver_attr_dmamemcpy);
  
    return 0;
}
Exemplo n.º 4
0
static void __exit rk28_ts_ak4183_exit(void)
{
	D("enter!\n");

    driver_remove_file(&ak4183_i2c_driver.driver, &driver_attr_touchcheck);
    driver_remove_file(&ak4183_i2c_driver.driver, &driver_attr_touchadc);
    driver_remove_file(&ak4183_i2c_driver.driver, &driver_attr_calistatus);
	driver_remove_file(&ak4183_i2c_driver.driver, &driver_attr_debug_ak4183);

	i2c_del_driver(&ak4183_i2c_driver);
	free_irq(7, NULL);
	input_unregister_device(g_ts_dev->input);
	input_free_device(g_ts_dev->input);
	kfree(g_ts_dev);
	g_ts_dev = NULL;
Exemplo n.º 5
0
static void __exit fpga_uinput_exit(void)
{
	free_irq(UINPUT_INT_NUM, NULL);
	iounmap(fpga_uinput_mem);
	release_mem_region(UINPUT_BASE, UINPUT_SIZE);
	driver_remove_file(&fpga_uinput_driver, &driver_attr_fpga_uinput);
	driver_unregister(&fpga_uinput_driver);
}
Exemplo n.º 6
0
void
unregister_cu3088_discipline(struct ccwgroup_driver *dcp)
{
	if (!dcp)
		return;

	driver_remove_file(&dcp->driver, &driver_attr_group);
	ccwgroup_driver_unregister(dcp);
}
Exemplo n.º 7
0
static void driver_remove_attrs(struct bus_type * bus, struct device_driver * drv)
{
	int i;

	if (bus->drv_attrs) {
		for (i = 0; attr_name(bus->drv_attrs[i]); i++)
			driver_remove_file(drv, &bus->drv_attrs[i]);
	}
}
Exemplo n.º 8
0
static int __devexit imx_3stack_ak4647_remove(struct platform_device *pdev)
{
	struct snd_soc_machine *machine = pdev->dev.driver_data;

	imx_3stack_mach = NULL;
	driver_remove_file(pdev->dev.driver, &driver_attr_headphone);
	kfree(machine);
	return 0;
}
Exemplo n.º 9
0
static int __init hfc_init_module(void)
{
	int err;

	hfc_msg(KERN_INFO, hfc_DRIVER_DESCR " loading\n");

	atomic_set(&module_refcnt, 0);

	hfc_hdlc_framer_class = ks_feature_register("hdlc_framer");
	if (!hfc_hdlc_framer_class) {
		err = -ENOMEM;
		goto err_register_hdlc_framer;
	}

	hfc_hdlc_deframer_class = ks_feature_register("hdlc_deframer");
	if (!hfc_hdlc_deframer_class) {
		err = -ENOMEM;
		goto err_register_hdlc_deframer;
	}

	hfc_octet_reverser_class = ks_feature_register("octet_reverser");
	if (!hfc_octet_reverser_class) {
		err = -ENOMEM;
		goto err_register_octet_reverser;
	}

	err = pci_register_driver(&hfc_driver);
	if (err < 0)
		goto err_pci_register_driver;

#ifdef DEBUG_CODE
	err = driver_create_file(
		&hfc_driver.driver,
		&driver_attr_debug_level);
	if (err < 0)
		goto err_create_file_debug_level;
#endif

	return 0;

#ifdef DEBUG_CODE
	driver_remove_file(
		&hfc_driver.driver,
		&driver_attr_debug_level);
err_create_file_debug_level:
#endif
err_pci_register_driver:
	ks_feature_unregister(hfc_octet_reverser_class);
err_register_octet_reverser:
	ks_feature_unregister(hfc_hdlc_deframer_class);
err_register_hdlc_deframer:
	ks_feature_unregister(hfc_hdlc_framer_class);
err_register_hdlc_framer:

	return err;
}
Exemplo n.º 10
0
void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
{
	struct device_driver *driverfs = &dgnc_driver->driver;
	driver_remove_file(driverfs, &driver_attr_version);
	driver_remove_file(driverfs, &driver_attr_boards);
	driver_remove_file(driverfs, &driver_attr_maxboards);
	driver_remove_file(driverfs, &driver_attr_debug);
	driver_remove_file(driverfs, &driver_attr_rawreadok);
	driver_remove_file(driverfs, &driver_attr_pollrate);
	driver_remove_file(driverfs, &driver_attr_pollcounter);
	driver_remove_file(driverfs, &driver_attr_state);
}
gceSTATUS
_PutPower(
    IN gckPLATFORM Platform
    )
{
    struct imx_priv *priv = Platform->priv;

    /*Disable clock*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
    if (priv->clk_3d_axi) {
       clk_put(priv->clk_3d_axi);
       priv->clk_3d_axi = NULL;
    }
#endif
    if (priv->clk_3d_core) {
       clk_put(priv->clk_3d_core);
       priv->clk_3d_core = NULL;
    }
    if (priv->clk_3d_shader) {
       clk_put(priv->clk_3d_shader);
       priv->clk_3d_shader = NULL;
    }
    if (priv->clk_2d_core) {
       clk_put(priv->clk_2d_core);
       priv->clk_2d_core = NULL;
    }
    if (priv->clk_2d_axi) {
       clk_put(priv->clk_2d_axi);
       priv->clk_2d_axi = NULL;
    }
    if (priv->clk_vg_axi) {
       clk_put(priv->clk_vg_axi);
       priv->clk_vg_axi = NULL;
    }

#ifdef CONFIG_PM
    if(priv->pmdev)
        pm_runtime_disable(priv->pmdev);
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
    if (priv->gpu_regulator) {
       regulator_put(priv->gpu_regulator);
       priv->gpu_regulator = NULL;
    }
#endif

#if gcdENABLE_FSCALE_VAL_ADJUST
    UNREG_THERMAL_NOTIFIER(&thermal_hot_pm_notifier);

    driver_remove_file(pdevice->dev.driver, &driver_attr_gpu3DMinClock);
#endif

    return gcvSTATUS_OK;
}
Exemplo n.º 12
0
/*
 * Thanks to drivers making their tables __devinit, we can't allow manual
 * bind and unbind from userspace unless CONFIG_HOTPLUG is enabled.
 */
static int __must_check add_bind_files(struct device_driver *drv)
{
	int ret;

	ret = driver_create_file(drv, &driver_attr_unbind);
	if (ret == 0) {
		ret = driver_create_file(drv, &driver_attr_bind);
		if (ret)
			driver_remove_file(drv, &driver_attr_unbind);
	}
	return ret;
}
static int imx_3stack_alc5623_remove(struct platform_device *pdev)
{
	struct mxc_audio_platform_data *plat = pdev->dev.platform_data;
	struct imx_3stack_priv *priv = &card_priv;

	if (plat->finit)
		plat->finit();

	driver_remove_file(pdev->dev.driver, &driver_attr_headphone);

	return 0;
}
Exemplo n.º 14
0
/*----------------------------------------------------------------------------*/
static int kpd_delete_attr(struct device_driver *driver)
{
	int idx, err = 0;
	int num = (int)(sizeof(kpd_attr_list) / sizeof(kpd_attr_list[0]));

	if (!driver)
		return -EINVAL;

	for (idx = 0; idx < num; idx++)
		driver_remove_file(driver, kpd_attr_list[idx]);

	return err;
}
Exemplo n.º 15
0
/*
 * test_create_file
 *	make test call to create sysfs file for the
 *	driver and if that call is successful then
 *	make a call to remove the file
 */
static int test_create_file() {
	struct device_driver *drv = &test_driver;

	if (driver_create_file(drv, &driver_attr_new_id)) {
		printk("tbase: failed create sysfs file\n");
		return 1;
	}
	else {
		printk("tbase: created sysfs file\n");
		driver_remove_file(drv, &driver_attr_new_id);
		return 0;
	}

}
Exemplo n.º 16
0
static void altera_cvp_remove(struct pci_dev *pdev)
{
	struct fpga_manager *mgr = pci_get_drvdata(pdev);
	struct altera_cvp_conf *conf = mgr->priv;
	u16 cmd;

	driver_remove_file(&altera_cvp_driver.driver, &driver_attr_chkcfg);
	fpga_mgr_unregister(&pdev->dev);
	pci_iounmap(pdev, conf->map);
	pci_release_region(pdev, CVP_BAR);
	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
	cmd &= ~PCI_COMMAND_MEMORY;
	pci_write_config_word(pdev, PCI_COMMAND, cmd);
}
Exemplo n.º 17
0
static int lcdc_auo_panel_off(struct platform_device *pdev)
{
	pr_debug("%s ++ entering\n", __func__);
	driver_remove_file(pdev->dev.driver, &driver_attr_lcm_id);
	panel_poweron(0);
#ifdef CONFIG_MACH_Q8K_A1_EVT
	gpio_set_value(GPIO_BLPWM,0);  //backlight power off
#endif
	gpio_tlmm_config(GPIO_CFG(GPIO_PCLK, 0, GPIO_CFG_INPUT,	GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_DISABLE);
	gpio_tlmm_config(GPIO_CFG(GPIO_VSYNC, 0, GPIO_CFG_INPUT,	GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_DISABLE);
	gpio_tlmm_config(GPIO_CFG(GPIO_HSYNC, 0, GPIO_CFG_INPUT,	GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_DISABLE);
	gpio_tlmm_config(GPIO_CFG(GPIO_VDEN, 0, GPIO_CFG_INPUT,	GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_DISABLE);
	pr_debug("%s -- leaving\n", __func__);
	return 0;
}
Exemplo n.º 18
0
/*----------------------------------------------------------------------------*/
static int shf_delete_attr(struct device_driver *driver)
{
    int idx ,err = 0;
    int num = (int)(sizeof(shf_attr_list)/sizeof(shf_attr_list[0]));

    if(driver == NULL) {
        return -EINVAL;
    }

    for(idx = 0; idx < num; idx++) {
        driver_remove_file(driver, shf_attr_list[idx]);
    }
    
    return err;
}
Exemplo n.º 19
0
/**
 * bus_remove_driver - delete driver from bus's knowledge.
 * @drv: driver.
 *
 * Detach the driver from the devices it controls, and remove
 * it from its bus's list of drivers. Finally, we drop the reference
 * to the bus we took in bus_add_driver().
 */
void bus_remove_driver(struct device_driver *drv)
{
	if (!drv->bus)
		return;

	remove_bind_files(drv);
	driver_remove_attrs(drv->bus, drv);
	driver_remove_file(drv, &driver_attr_uevent);
	klist_remove(&drv->p->knode_bus);
	pr_debug("bus: '%s': remove driver %s\n", drv->bus->name, drv->name);
	driver_detach(drv);
	module_remove_driver(drv);
	kobject_put(&drv->p->kobj);
	bus_put(drv->bus);
}
Exemplo n.º 20
0
static void __exit hfc_module_exit(void)
{
printk(KERN_DEBUG "module_exit()\n");

#ifdef DEBUG_CODE
	driver_remove_file(
		&hfc_driver.driver,
		&driver_attr_debug_level);
#endif

	pci_unregister_driver(&hfc_driver);

	ks_feature_unregister(hfc_octet_reverser_class);
	ks_feature_unregister(hfc_hdlc_deframer_class);
	ks_feature_unregister(hfc_hdlc_framer_class);

	hfc_msg(KERN_INFO, hfc_DRIVER_DESCR " unloaded\n");
}
static int yas537_delete_attr(struct device_driver *driver)
{
	int ret = 0;
	int i = 0;
	int num = sizeof(yas537_attr_list)/sizeof(yas537_attr_list[0]);

	if(NULL == driver)
	{
		return -EINVAL;
	}
	for(i = 0; i < num; i++)
	{
		driver_remove_file(driver, yas537_attr_list[i]);
	}
	
	return ret;

}
Exemplo n.º 22
0
static int __init fpga_uinput_init(void)
{
	int ret;
	struct resource *res;

	ret = driver_register(&fpga_uinput_driver);
	if (ret < 0)
		goto fail_driver_register;

	ret = driver_create_file(&fpga_uinput_driver,
			&driver_attr_fpga_uinput);
	if (ret < 0)
		goto fail_create_file;

	res = request_mem_region(UINPUT_BASE, UINPUT_SIZE, "fpga_uinput");
	if (res == NULL) {
		ret = -EBUSY;
		goto fail_request_mem;
	}

	fpga_uinput_mem = ioremap(UINPUT_BASE, UINPUT_SIZE);
	if (fpga_uinput_mem == NULL) {
		ret = -EFAULT;
		goto fail_ioremap;
	}

	ret = request_irq(UINPUT_INT_NUM, fpga_uinput_interrupt,
			0, "fpga_uinput", NULL);
	if (ret < 0)
		goto fail_request_irq;

	return 0;

fail_request_irq:
	iounmap(fpga_uinput_mem);
fail_ioremap:
	release_mem_region(UINPUT_BASE, UINPUT_SIZE);
fail_request_mem:
	driver_remove_file(&fpga_uinput_driver, &driver_attr_fpga_uinput);
fail_create_file:
	driver_unregister(&fpga_uinput_driver);
fail_driver_register:
	return ret;
}
Exemplo n.º 23
0
static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv)
{
	int error = 0;
	int i;

	if (bus->drv_attrs) {
		for (i = 0; attr_name(bus->drv_attrs[i]); i++) {
			error = driver_create_file(drv, &bus->drv_attrs[i]);
			if (error)
				goto err;
		}
	}
done:
	return error;
err:
	while (--i >= 0)
		driver_remove_file(drv, &bus->drv_attrs[i]);
	goto done;
}
Exemplo n.º 24
0
static void __exit bus_exit(void)
{
	int i;
	for (i = 0; my_bus_attrs[i]; i++)
		bus_remove_file(&my_bus, my_bus_attrs[i]);

	for (i = 0; my_drv_attrs[i]; i++)
		driver_remove_file(&my_drv.drv, my_drv_attrs[i]);
	
	for (i = 0; my_dev_attrs[i]; i++)
		device_remove_file(&my_dev.dev, my_dev_attrs[i]);


	my_driver_unregister(&my_drv);
	my_device_unregister(&my_dev);
	bus_unregister(&my_bus);
	

}
Exemplo n.º 25
0
static int __devexit imx_3stack_audio_remove(struct platform_device *pdev)
{
	struct snd_soc_machine *machine = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec;
	struct snd_soc_pcm_link *pcm_link;

	gpio_free_irq(WM8903_IRQ_GPIO_PORT, WM8903_IRQ_GPIO_NUM, GPIO_LOW_PRIO);

	pcm_link = list_first_entry(&machine->active_list,
				    struct snd_soc_pcm_link, active_list);

	codec = pcm_link->codec;
	codec->ops->io_remove(codec, machine);

	snd_soc_machine_free(machine);

	driver_remove_file(pdev->dev.driver, &driver_attr_headphone);
	kfree(machine);
	return 0;
}
Exemplo n.º 26
0
static void remove_bind_files(struct device_driver *drv)
{
	driver_remove_file(drv, &driver_attr_bind);
	driver_remove_file(drv, &driver_attr_unbind);
}
Exemplo n.º 27
0
static int __devinit imx_3stack_sgtl5000_audio_probe(struct platform_device *pdev)
{
	struct snd_soc_machine *machine;
	struct mxc_sgtl5000_platform_data *plat = pdev->dev.platform_data;
	struct snd_soc_pcm_link *audio;
	int ret;

	machine = kzalloc(sizeof(struct snd_soc_machine), GFP_KERNEL);
	if (machine == NULL)
		return -ENOMEM;

	platform_set_drvdata(pdev, machine);
	machine->owner = THIS_MODULE;
	machine->pdev = pdev;
	machine->name = "i.MX_3STACK";
	machine->longname = "SGTL5000";
	machine->ops = &machine_ops;

	/* register card */
	ret =
	    snd_soc_new_card(machine, 1, SNDRV_DEFAULT_IDX1,
			     SNDRV_DEFAULT_STR1);
	if (ret < 0) {
		pr_err("%s: failed to create pcms\n", __func__);
		goto err;
	}

	/* SGTL5000 interface */
	ret = -ENODEV;

	if (plat->src_port == 2)
		audio = snd_soc_pcm_link_new(machine, "imx_3stack-audio",
					    &imx_3stack_pcm_ops, imx_pcm,
					    sgtl5000_codec, sgtl5000_dai,
					    imx_ssi_3);
	else
		audio = snd_soc_pcm_link_new(machine, "imx_3stack-audio",
					    &imx_3stack_pcm_ops, imx_pcm,
					    sgtl5000_codec, sgtl5000_dai,
					    imx_ssi_1);
	if (audio == NULL) {
		pr_err("failed to create PCM link\n");
		goto link_err;
	}
	ret = snd_soc_pcm_link_attach(audio);
	if (ret < 0) {
		pr_err("%s: failed to attach audio pcm\n", __func__);
		goto link_err;
	}

	ret = driver_create_file(pdev->dev.driver, &driver_attr_headphone);
	if (ret < 0) {
		pr_err("%s:failed to create driver_attr_headphone\n", __func__);
		goto sysfs_err;
	}

	return ret;

sysfs_err:
	driver_remove_file(pdev->dev.driver, &driver_attr_headphone);
link_err:
	snd_soc_machine_free(machine);
err:
	kfree(machine);
	return ret;

}
Exemplo n.º 28
0
static void __exit scdriver_exit(void)
{
	driver_remove_file(&scdriver, &driver_attr_version);
	driver_unregister(&scdriver);
}
Exemplo n.º 29
0
static void em8300_sysfs_preunregister_driver(void)
{
	driver_remove_file(&em8300_driver.driver, &driver_attr_version);
}
Exemplo n.º 30
0
static int platform_probe(struct platform_device *pdev)
{
	int ret_val;
	struct resource *r;
	int irq;
	struct clk *clk;
	unsigned long clk_rate;
	struct resource *demo_driver_mem_region;
	uint32_t io_result;
	uint32_t period_100ms;

	pr_info("platform_probe enter\n");

	ret_val = -EBUSY;

	/* acquire the probe lock */
	if (down_interruptible(&g_dev_probe_sem))
		return -ERESTARTSYS;

	if (g_platform_probe_flag != 0)
		goto bad_exit_return;

	ret_val = -EINVAL;

	/* get our first memory resource */
	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (r == NULL) {
		pr_err("IORESOURCE_MEM, 0 does not exist\n");
		goto bad_exit_return;
	}

	g_demo_driver_base_addr = r->start;
	g_demo_driver_size = resource_size(r);

	/* get our interrupt resource */
	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		pr_err("irq not available\n");
		goto bad_exit_return;
	}

	g_demo_driver_irq = irq;

	/* get our clock resource */
	clk = clk_get(&pdev->dev, NULL);
	if (IS_ERR(clk)) {
		pr_err("clk not available\n");
		goto bad_exit_return;
	} else {
		clk_rate = clk_get_rate(clk);
	}

	g_demo_driver_clk_rate = clk_rate;

	ret_val = -EBUSY;

	/* reserve our memory region */
	demo_driver_mem_region = request_mem_region(g_demo_driver_base_addr,
						    g_demo_driver_size,
						    "demo_driver_hw_region");
	if (demo_driver_mem_region == NULL) {
		pr_err("request_mem_region failed: g_demo_driver_base_addr\n");
		goto bad_exit_return;
	}

	/* ioremap our memory region */
	g_ioremap_addr = ioremap(g_demo_driver_base_addr, g_demo_driver_size);
	if (g_ioremap_addr == NULL) {
		pr_err("ioremap failed: g_demo_driver_base_addr\n");
		goto bad_exit_release_mem_region;
	}

	g_timer_base = g_ioremap_addr + TIMER_OFST;

	/* initialize our peripheral timer hardware */
	io_result = ioread32(IOADDR_ALTERA_AVALON_TIMER_STATUS(g_timer_base));
	io_result &= ALTERA_AVALON_TIMER_STATUS_TO_MSK |
	    ALTERA_AVALON_TIMER_STATUS_RUN_MSK;
	if (io_result != 0) {
		pr_err("peripheral timer hardware, incorrect initial state");
		goto bad_exit_iounmap;
	}

	period_100ms = (g_demo_driver_clk_rate / 10) - 1;
	iowrite32(period_100ms,
		  IOADDR_ALTERA_AVALON_TIMER_PERIODL(g_timer_base));
	iowrite32(period_100ms >> 16,
		  IOADDR_ALTERA_AVALON_TIMER_PERIODH(g_timer_base));

	/* register our interrupt handler */
	spin_lock_init(&g_irq_lock);
	g_max_irq_delay = 0;
	g_min_irq_delay = 0xFFFFFFFF;

	ret_val = request_irq(g_demo_driver_irq,
			      demo_driver_interrupt_handler,
			      0,
			      the_platform_driver.driver.name,
			      &the_platform_driver);

	if (ret_val) {
		pr_err("request_irq failed");
		goto bad_exit_iounmap;
	}

	ret_val = -EBUSY;

	/* start our timer and enable our timer hardware interrupts */
	iowrite32(ALTERA_AVALON_TIMER_CONTROL_ITO_MSK |
		  ALTERA_AVALON_TIMER_CONTROL_CONT_MSK |
		  ALTERA_AVALON_TIMER_CONTROL_START_MSK,
		  IOADDR_ALTERA_AVALON_TIMER_CONTROL(g_timer_base));

	io_result = ioread32(IOADDR_ALTERA_AVALON_TIMER_STATUS(g_timer_base));
	io_result &= ALTERA_AVALON_TIMER_STATUS_RUN_MSK;
	if (io_result == 0) {
		/* stop our timer and disable our timer hardware interrupts */
		iowrite32(ALTERA_AVALON_TIMER_CONTROL_STOP_MSK,
			  IOADDR_ALTERA_AVALON_TIMER_CONTROL(g_timer_base));

		pr_err("peripheral timer hardware, failed to start");
		goto bad_exit_freeirq;
	}

	/* create the sysfs entries */
	ret_val = driver_create_file(&the_platform_driver.driver,
				     &driver_attr_irq_delays);
	if (ret_val != 0) {
		pr_err("failed to create irq_delays sysfs entry");
		goto bad_exit_stop_timer;
	}

	ret_val = driver_create_file(&the_platform_driver.driver,
				     &driver_attr_interval);
	if (ret_val != 0) {
		pr_err("failed to create interval sysfs entry");
		goto bad_exit_remove_irq_delays;
	}

	g_platform_probe_flag = 1;
	up(&g_dev_probe_sem);
	pr_info("platform_probe exit\n");
	return 0;

bad_exit_remove_irq_delays:
	driver_remove_file(&the_platform_driver.driver,
			   &driver_attr_irq_delays);
bad_exit_stop_timer:
	iowrite32(ALTERA_AVALON_TIMER_CONTROL_STOP_MSK,
		  IOADDR_ALTERA_AVALON_TIMER_CONTROL(g_timer_base));
	/* ensure there is no pending IRQ */
	do {
		io_result =
		    ioread32(IOADDR_ALTERA_AVALON_TIMER_STATUS(g_timer_base));
		io_result &= ALTERA_AVALON_TIMER_STATUS_TO_MSK;
	} while (io_result != 0);
bad_exit_freeirq:
	free_irq(g_demo_driver_irq, &the_platform_driver);
bad_exit_iounmap:
	iounmap(g_ioremap_addr);
bad_exit_release_mem_region:
	release_mem_region(g_demo_driver_base_addr, g_demo_driver_size);
bad_exit_return:
	up(&g_dev_probe_sem);
	pr_info("platform_probe bad_exit\n");
	return ret_val;
}