From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751490AbbJDMEh (ORCPT ); Sun, 4 Oct 2015 08:04:37 -0400 Received: from smtp-out-225.synserver.de ([212.40.185.225]:1041 "EHLO smtp-out-190.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751412AbbJDMEg (ORCPT ); Sun, 4 Oct 2015 08:04:36 -0400 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 19538 Message-ID: <561115CF.9020006@metafoo.de> Date: Sun, 04 Oct 2015 14:04:31 +0200 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Shraddha Barke , Jonathan Cameron , Michael Hennerich CC: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: iio: meter: Use devm functions References: <1443933272-23398-1-git-send-email-shraddha.6596@gmail.com> In-Reply-To: <1443933272-23398-1-git-send-email-shraddha.6596@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2015 06:34 AM, Shraddha Barke wrote: > [...] Hi, Thanks for the patch. > - st->trig = iio_trigger_alloc("%s-dev%d", > - spi_get_device_id(st->us)->name, > - indio_dev->id); > + st->trig = devm_iio_trigger_alloc(&indio_dev->id, "%s-dev%d", But I don't think this compiles. The first parameter needs to be a struct device. > + spi_get_device_id(st->us)->name, > + indio_dev->id); > if (!st->trig) { > ret = -ENOMEM; > goto error_ret; > } > > - ret = request_irq(st->us->irq, > - ade7758_data_rdy_trig_poll, > - IRQF_TRIGGER_LOW, > - spi_get_device_id(st->us)->name, > - st->trig); > + ret = devm_request_irq(&indio_dev->dev, st->us->irq, And the device also needs to be the device from whose probe function this is called. Please add a parameter to ade7758_probe_trigger that supplies this device. > + ade7758_data_rdy_trig_poll, > + IRQF_TRIGGER_LOW, > + spi_get_device_id(st->us)->name, > + st->trig); [...]