Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp231973pxb; Fri, 3 Sep 2021 00:31:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwfjN620aq0IdHh1hfsPnfgNNncIOd6eWpnKEkS2G8o7kKu9csj2JWW8Caac25zuHHc26A X-Received: by 2002:a17:906:659:: with SMTP id t25mr2612409ejb.372.1630654299835; Fri, 03 Sep 2021 00:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630654299; cv=none; d=google.com; s=arc-20160816; b=roc3PhtxnYNSyklWFONGO9IuYVRZ0JiDFKggmbRCvepZvg6eG5G0DvglFxULu1aacH 6nokvix5YMCT6s7lU47jPZnIEvRtIJnA3JpQK1vZ6/waXWZ2N3YP1YfQxMUO4jLOMaa+ ltlhJxvI3Td3EKPtwLwyjItwZeT0SK3fXgXnApAy570lZVRpas3V1I20DqQieeHM8ahb IJblSh9rz+Zrt1fl7LdYIOfQEHbOyRudsQdOUgORCD+Q4I5GlaIGeZdmHbqhZWE0U7gw Wwg1/SnXD4iCW2kzCFZ6OOTUj+K5CMHKsm41xbeW3ebpjFWwPD2OD52m+6Zl28LU51L9 rNXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DLNVH8XFndwKpvPMj1mgpvvZHBUNyj5D1E9ht5yoDp4=; b=XtTKpcwGmShdZ/Ft3PkqMr/1GKscJCv/1pmdo2CJoQkBugIyZTRt9koKmd8LH9Gnxe 855taMlDnhJSrXTaMTVfhCXnAivXpaGa+Fs5IwdxAUsEpzrfYWoYYWuqsKKaR6/TBMVn fV1y3TzEQLQbfRSa5yDkR2tY+B2RxENKd1R0xzqfP8il8ZRKroFvc3CgH8zhD1YAga4c uJ6nVfOsudujWLOS8xrV0sTlvSH5D1WtKGyPnZm0r1HRKW12v8NgVZxLjivmtl28UxxU oD8UPi+98KYZXEmJqb4uvG0EOpNGa+nvqg5/IxQryXR/wHx3WIL0ohPCKsmg1QaoErLq nEdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=io0DFqQy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si4124407edc.1.2021.09.03.00.31.12; Fri, 03 Sep 2021 00:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=io0DFqQy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347992AbhICHag (ORCPT + 99 others); Fri, 3 Sep 2021 03:30:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347912AbhICHad (ORCPT ); Fri, 3 Sep 2021 03:30:33 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073B0C061575 for ; Fri, 3 Sep 2021 00:29:34 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id lc21so10172561ejc.7 for ; Fri, 03 Sep 2021 00:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DLNVH8XFndwKpvPMj1mgpvvZHBUNyj5D1E9ht5yoDp4=; b=io0DFqQyxa4evyztTcJaGZnx5fg5ZlUTzYhTS6zCTPK4GavCEQh+Z2CuBf+d7dgZrn BLqzaRUgDWMuTiTIT+oljXws+f01Av0fdFw7GVonAcgLVHKsZhw/LafdHbMPAEo3lmmM wJYf3ALSJoWUqvyke95ycPxVTk9702nd6SN/Qmv8uurhkOG3eczMO6Ozr1qUXvPr7Znq 1dv1vlxeeSJgxjWXPlLN9471pU5md8+vbY9hk0nWqhV4zFRsxrta345cYGM3LJvdwGW/ xcRVN/5LPPlcTNTJogYsqQy7NNYcDkFlDJ6wAAg2LL+qmdv/un8wCFk5/sVy7gmUPzhH JL6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DLNVH8XFndwKpvPMj1mgpvvZHBUNyj5D1E9ht5yoDp4=; b=P4ix6ubullW9cUYAv6NA/4YVfTL8dZ7DDLTpSTWI2M9tysGHAoi46OwJE9fm7Zrsro LBN67OItAnMr8AS6O3AcC4tdaDc/y+JWRo5005XfCX9h0Pi9IRZI76WplS0Kb8LtuZ9G GBYUnynEv5qMkMOYPrHuyJlwCuefM7M3aLFcEHlxBHU/HL4o7jBmLfxRk94hjYgdPvVB M13ZR/xz+D+5SrWlzPSNPzd1AAVynaCeyFWBgZvE6MEuxVFeJdjymXLrWoS8GQgJ98n4 URZudlzQQ0trWz/bKt3FUo3o/QC128olGWQjhxXdBfJ6cC5OkD06VAJMqnDsChCAcORS Weyg== X-Gm-Message-State: AOAM532mWPy5Isn+ALotbJmsI9s5AQaLy+SFljQBgX0Z/jDqbTtUmVOS tcHJFv+/RJXB0hTxq43UPyyr4A== X-Received: by 2002:a17:906:660f:: with SMTP id b15mr2568809ejp.491.1630654172607; Fri, 03 Sep 2021 00:29:32 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id a15sm2376969edr.2.2021.09.03.00.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 00:29:32 -0700 (PDT) From: Alexandru Ardelean To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: jic23@kernel.org, hdegoede@redhat.com, wens@csie.org, andriy.shevchenko@linux.intel.com, Alexandru Ardelean Subject: [PATCH 2/5] iio: adc: intel_mrfld_adc: convert probe to full device-managed Date: Fri, 3 Sep 2021 10:29:14 +0300 Message-Id: <20210903072917.45769-3-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210903072917.45769-1-aardelean@deviqon.com> References: <20210903072917.45769-1-aardelean@deviqon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only call in the remove hook is the iio_map_array_unregister() call. Since we have a devm_iio_map_array_register() function now, we can use that and remove the remove hook entirely. The IIO device was registered with the devm_iio_device_register() prior to this change. Also, the platform_set_drvdata() can be removed now, since it was used only in the remove hook. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/intel_mrfld_adc.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/iio/adc/intel_mrfld_adc.c b/drivers/iio/adc/intel_mrfld_adc.c index 75394350eb4c..616de0c3a049 100644 --- a/drivers/iio/adc/intel_mrfld_adc.c +++ b/drivers/iio/adc/intel_mrfld_adc.c @@ -205,8 +205,6 @@ static int mrfld_adc_probe(struct platform_device *pdev) if (ret) return ret; - platform_set_drvdata(pdev, indio_dev); - indio_dev->name = pdev->name; indio_dev->channels = mrfld_adc_channels; @@ -214,28 +212,11 @@ static int mrfld_adc_probe(struct platform_device *pdev) indio_dev->info = &mrfld_adc_iio_info; indio_dev->modes = INDIO_DIRECT_MODE; - ret = iio_map_array_register(indio_dev, iio_maps); + ret = devm_iio_map_array_register(dev, indio_dev, iio_maps); if (ret) return ret; - ret = devm_iio_device_register(dev, indio_dev); - if (ret < 0) - goto err_array_unregister; - - return 0; - -err_array_unregister: - iio_map_array_unregister(indio_dev); - return ret; -} - -static int mrfld_adc_remove(struct platform_device *pdev) -{ - struct iio_dev *indio_dev = platform_get_drvdata(pdev); - - iio_map_array_unregister(indio_dev); - - return 0; + return devm_iio_device_register(dev, indio_dev); } static const struct platform_device_id mrfld_adc_id_table[] = { @@ -249,7 +230,6 @@ static struct platform_driver mrfld_adc_driver = { .name = "mrfld_bcove_adc", }, .probe = mrfld_adc_probe, - .remove = mrfld_adc_remove, .id_table = mrfld_adc_id_table, }; module_platform_driver(mrfld_adc_driver); -- 2.31.1