Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755774AbcDKQLY (ORCPT ); Mon, 11 Apr 2016 12:11:24 -0400 Received: from mga09.intel.com ([134.134.136.24]:4589 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755043AbcDKQLX (ORCPT ); Mon, 11 Apr 2016 12:11:23 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,462,1455004800"; d="scan'208";a="782571020" Subject: Re: [PATCH 5/5] max44000: Initial triggered buffer support To: Peter Meerwald-Stadler References: Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Daniel Baluta From: Crestez Dan Leonard Message-ID: <570BCCA5.7020004@intel.com> Date: Mon, 11 Apr 2016 19:11:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 887 Lines: 27 On 04/07/2016 10:59 PM, Peter Meerwald-Stadler wrote: >> static int max44000_probe(struct i2c_client *client, >> const struct i2c_device_id *id) >> { >> @@ -513,6 +569,12 @@ static int max44000_probe(struct i2c_client *client, >> return ret; >> } >> >> + ret = iio_triggered_buffer_setup(indio_dev, NULL, max44000_trigger_handler, NULL); >> + if (ret < 0) { >> + dev_err(&client->dev, "iio triggered buffer setup failed\n"); >> + return ret; >> + } >> + >> return iio_device_register(indio_dev); > > no devm_ possible anymore :-) It's not clear to me why explicit calls to iio_triggered_buffer_cleanup are done in every driver. Wouldn't it be possible for iio_dev_release to call iio_triggered_buffer_cleanup? That would require triggered_buffer_cleanup to explictly NULL the fields it deallocates so that duplicate cleanups don't crash. -- Regards, Leonard