Re: [PATCH v2] [MFD] i2c-htcpld: Add the HTCPLD driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 12, 2009 at 01:29:32PM -0800, Cory Maccarrone wrote:

> +static irqreturn_t htcpld_handler(int irq, void *dev)
> +{
> +	struct htcpld_data *htcpld = dev;

...

> +	/* To properly dispatch IRQ events, we need to read from the
> +	 * chip.  This is an I2C action that could possibly sleep
> +	 * (which is bad here, since we're in interrupt context).
> +	 * As such, the rest of this is implemented in a process-context
> +	 * workload that will take care of the actual dispatch.
> +	 */
> +	schedule_delayed_work(&(htcpld->interrupt_work), 0);

request_threaded_irq() probably does what you want here and is more
friendly to things like lockdep.  There's an example of handling this
sort of chip with the genirq infrastructure in the WM831x driver.

> +static int __devinit htcpld_core_probe(struct platform_device *pdev)
> +{
> +	struct htcpld_data *htcpld;
> +	struct device *dev = &pdev->dev;
> +	struct htcpld_core_platform_data *pdata;
> +	struct resource *res;
> +	int i, ret = 0;
> +	unsigned int irq, irq_end;
> +
> +	if (!dev)
> +		return -ENODEV;
> +
> +	pdata = (struct htcpld_core_platform_data *)dev->platform_data;

You don't need to cast awat from void.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux