Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1322623ybi; Sat, 27 Jul 2019 07:14:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBcH0DX56+XM1F0ZVDmqOrrNv31bukNKLrBTN8Cvoo+IvH7XLlWXe+h+A/PkPLJzSppphG X-Received: by 2002:a17:90a:3086:: with SMTP id h6mr105363167pjb.14.1564236867927; Sat, 27 Jul 2019 07:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564236867; cv=none; d=google.com; s=arc-20160816; b=aKW1fSn5HBc9YVraVth/v/KM5/mwVJhBleNUY8TKlPnQxHnVMYiK7cgqPCcf90XUHr eFsxcYp8buiCTUuNngCRaVmQL5l8XhpL/kgSd9NPj+VFbk7yRAYBNkqjDZjtm3tGbkRJ Sb/RB+oDcXAmqIvUUTXpr5S+HZUVEp88CKz43pwpvpmcp1z8/KpPOS3JOZyfuTfhhuSK 59nLKx3yNPeLVu9c4A+siCBMhc0Ugcse1hvQLjgI5dsuIxV7w+ZyZgyqTE9bR0F+ks3k bcTbjQUE2GPiWyVKJpN2cy2PmtH6IMDduQq3kpkEVwruR0s8QHbgPOmjPKjfeueindIv hKUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=PV5OB46JzXqQ6kYFCOCo36SEUvQpdbtRXdokoDxt3nA=; b=zA4Bb4Uv4Eyp6sykUqETCXGis/IK0g9x8PFYjDKxk2Z65Man28UAcfj4ZFx82g1yXx AMyHAfoj48qNY9sVy3QnVqmxRbPwnM3WRitbKWEmqjKQDWoyXrUlAmQoHO8CR89Kng2+ sQMIkKUNkk7mqUQgdUFdD45w5/ElrPD5kPXZitjdFRdVahMiv8DLkUUB47Bpdc7Pf2hS Xqe1YSMfyQe48e91i7/JfjZjV4Z8PgIt/a8aebNZ4RHgUDNfrmsAxj/O649+NyDCDbYS Mdasj3pGRDkAA84mK+r1sduSNhX45NeQkQpY3Rgx8RZN+E1Zh/leeSEOrv3W7FJy4cRf Jwgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PjR7grEf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si2444400plr.252.2019.07.27.07.13.59; Sat, 27 Jul 2019 07:14:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PjR7grEf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387691AbfG0OBI (ORCPT + 99 others); Sat, 27 Jul 2019 10:01:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:54706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387576AbfG0OBH (ORCPT ); Sat, 27 Jul 2019 10:01:07 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CA3120840; Sat, 27 Jul 2019 14:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564236066; bh=FSQSrO+2OwW4fijGmMlDa81a0rfWwjuQHjY9U+gpkrw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PjR7grEfGHOQFtuaNbz5IhNwZ5v/m+2PD7bg9i04Qhls6KRovzoTPO7oljMWSpXs6 TBOczKpYe2CL11a1hqLvL2sqnSaKNLMMOYBrKiP136O6NFzFJxWwVnfaSSupW1IH0/ sOwS2KI4W2VVqYY+OKtXZ0kSdf7snrc/eOzXwPlM= Date: Sat, 27 Jul 2019 15:01:01 +0100 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "hslester96@gmail.com" , "Popa, Stefan Serban" , "devel@driverdev.osuosl.org" , "gregkh@linuxfoundation.org" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Hennerich, Michael" , "lars@metafoo.de" Subject: Re: [PATCH] staging: iio: ad2s1210: Use device-managed API Message-ID: <20190727150101.43bb4314@archlinux> In-Reply-To: References: <20190726110742.20445-1-hslester96@gmail.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Jul 2019 12:36:08 +0000 "Ardelean, Alexandru" wrote: > On Fri, 2019-07-26 at 19:07 +0800, Chuhong Yuan wrote: > > [External] > > > > Use device-managed API to simplify the code. > > The remove function is redundant now and can > > be deleted. > > Reviewed-by: Alexandru Ardelean The end of this probe function is rather odd and probably needs sorting out as I imagine that needs to happen before the device is exposed to userspace. Nothing to do with this patch though which is great. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/staging/iio/resolver/ad2s1210.c | 12 +----------- > > 1 file changed, 1 insertion(+), 11 deletions(-) > > > > diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c > > index 0c1bd108c386..4b25a3a314ed 100644 > > --- a/drivers/staging/iio/resolver/ad2s1210.c > > +++ b/drivers/staging/iio/resolver/ad2s1210.c > > @@ -671,7 +671,7 @@ static int ad2s1210_probe(struct spi_device *spi) > > indio_dev->num_channels = ARRAY_SIZE(ad2s1210_channels); > > indio_dev->name = spi_get_device_id(spi)->name; > > > > - ret = iio_device_register(indio_dev); > > + ret = devm_iio_device_register(&spi->dev, indio_dev); > > if (ret) > > return ret; > > > > @@ -683,15 +683,6 @@ static int ad2s1210_probe(struct spi_device *spi) > > return 0; > > } > > > > -static int ad2s1210_remove(struct spi_device *spi) > > -{ > > - struct iio_dev *indio_dev = spi_get_drvdata(spi); > > - > > - iio_device_unregister(indio_dev); > > - > > - return 0; > > -} > > - > > static const struct of_device_id ad2s1210_of_match[] = { > > { .compatible = "adi,ad2s1210", }, > > { } > > @@ -710,7 +701,6 @@ static struct spi_driver ad2s1210_driver = { > > .of_match_table = of_match_ptr(ad2s1210_of_match), > > }, > > .probe = ad2s1210_probe, > > - .remove = ad2s1210_remove, > > .id_table = ad2s1210_id, > > }; > > module_spi_driver(ad2s1210_driver);