Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1431268 > unrolled thread
| Started by | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| First post | 2016-06-26 03:10 +0200 |
| Last post | 2016-06-26 03:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v3 4/8] rtc: ac100: Add RTC driver for X-Powers AC100 Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-06-26 03:10 +0200
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Date | 2016-06-26 03:10 +0200 |
| Subject | Re: [PATCH v3 4/8] rtc: ac100: Add RTC driver for X-Powers AC100 |
| Message-ID | <rO6Kd-4xS-1@gated-at.bofh.it> |
On 20/06/2016 at 10:52:14 +0800, Chen-Yu Tsai wrote :
> +static int ac100_rtc_probe(struct platform_device *pdev)
> +{
> + struct ac100_dev *ac100 = dev_get_drvdata(pdev->dev.parent);
> + struct ac100_rtc_dev *chip;
> + int ret;
> +
> + chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
> + platform_set_drvdata(pdev, chip);
> + chip->dev = &pdev->dev;
> + chip->regmap = ac100->regmap;
> + mutex_init(&chip->mutex);
> +
> + chip->irq = of_irq_get(pdev->dev.of_node, 0);
Forgot that one, platform_get_irq() is probably more common but I don't
care that much. I think you can then avoid including of.h and of_irq.h.
> + if (chip->irq < 0) {
> + dev_err(&pdev->dev, "No IRQ resource\n");
> + return chip->irq;
> + }
> +
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Back to top | Article view | linux.kernel
csiph-web