Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3253687pxb; Sun, 26 Sep 2021 09:30:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyE033Oqc7x6sAVYoQpPOVuNMWc0XiAbPzlaJgr+APo3jg6SUXhHVrPAvvTcTkJDsJBLMxs X-Received: by 2002:a17:90a:29a6:: with SMTP id h35mr14755507pjd.188.1632673811312; Sun, 26 Sep 2021 09:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632673811; cv=none; d=google.com; s=arc-20160816; b=BLMzDCiKcz6zc1vggMt1OslKIsjKGcRk/z4FA+/EoGKP6Nk4JlFeHfSRLI3xDkdDmy V+PHzv8urfH62kfnpLZL7zFN6lo7Fz/FIFF7mccvY65bwtxIyGMhtz1MUay0ZtZhlYns zHl8C54uM5r+B4rX07ABU6QC4ZsWw8yzvftxS5xZA8GQyx/YrPE7EIy4bgnwMD+CA67Q uUF2wTRKeLmlbuWohEkcwQ0oGhCPGlJ0FTm/PIKiGa5B9yWAqAE0NM0oIVN7pWPgBrnV 3eSajfTwi6E2CzdF0zmPIiOEEgJO21+oEr9zvvIz69MewsWs9dVKdqE5+Nd/bCR/xSdr T37Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=7jucDxAZgXFO2xiPpoYJkT8xmT+xrk7gRKE4e9TEQU4=; b=Uiun4DI7ZcfSmFnqylxeEmJP26WCy5ayzx+81hnQCHNV+pAzT8W1TZnQafUL5Kat8U 4BB9U8igm3rbo05uB/hKsmH2JZZDsD+K85wxxp3Z6pCjbNbCJ8ZoDLgLJpgCmm0Q1fdf wnA628IP7YU89duh9lKRIr0/bgAjQWe91CuV5c+GjWPSEX4Z5Z7WsuLtYqLJ0mhAgBAW CgyxunCM3ENgr0v80AwllotbkaZC1UIoGE3V4Jt4YESKkQs1GFXAr67aVJ4EMd9zkKZ5 In3jwWUYN97FWpwqLt1RwaDh/IRx9VN1y5qHVKSMT0n57auORFr+NCWbOC2+Yadzq9VW 3Z1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=jotAFICW; 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 n3si18943361pgv.117.2021.09.26.09.29.58; Sun, 26 Sep 2021 09:30:11 -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=jotAFICW; 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 S232058AbhIZQav (ORCPT + 99 others); Sun, 26 Sep 2021 12:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232054AbhIZQau (ORCPT ); Sun, 26 Sep 2021 12:30:50 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46CE6C061575 for ; Sun, 26 Sep 2021 09:29:14 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id ee50so58555854edb.13 for ; Sun, 26 Sep 2021 09:29:14 -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:mime-version :content-transfer-encoding; bh=7jucDxAZgXFO2xiPpoYJkT8xmT+xrk7gRKE4e9TEQU4=; b=jotAFICWXy4a5lhFBAfBjvv0/xOsSC3yFTelep4P8kVqsSiYZ34vpXylx7uc+MY+Kp oYeQgPOnJ9INL6J7YXyWbxTVSvMZo2SIBvPrqwW8Nn8Ux46Igqbk47Kj+vqgQYlU55aB CpBgq99QsmmkkcXuv2G/zMMNwZBTETpadnM7v6QWgOBVzXrz3WJW1fXkYk52nX+T7X1f xkciLhI9uhUrWMip5PlsSbDB0SbPU2ix2Nc+SrALDkFmeXLydJEuhHq7v4vFLaJBjXpD Tih4GZAq6FavS/Gnb0v23eICQtu4RxfhtF5pYuPACsKYmC+AP3BkyCGIh0z1SRqvdvcf JGRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7jucDxAZgXFO2xiPpoYJkT8xmT+xrk7gRKE4e9TEQU4=; b=U/mCXsz6ZMSE+XvtX5OFBcI7cwRoL0I/baq9mtwSf49LGOefzKMWhSmug4/4RlxVc2 hZ+Duxoaxujy8CIeQZMgaosN+iF6SuLH5dqCDPaC6JrK5CT/NHMrV8JL4BiznjAtn48I xY9lE1TiMAttpefpHP+Ybo6626yCovFCAJeAvG3qgSoWBZLgVmh9FgvvSCLZ3chKRRkf 5ubW3RcaMmOI5CV9RutWK2sZ/wfSvUnZKzbYCjQ1+ZNt3P8d25anss/LjR8fc8TuDHH8 OkcCko81B2FAi5amBw5mmDSrHu9vj3VBiaqHEhv0XQQSjx8OCYQV7PsuEQq4F+PqxlU1 aSpw== X-Gm-Message-State: AOAM530HjTxvVK8E/Clv0gx4jrWVTN8hHxr8/Jry5V9dWvBtLNEI1RSS cGOphWsr6oaBnAsWMOhFSnJGD+T7tpzABg== X-Received: by 2002:a17:906:3054:: with SMTP id d20mr22181545ejd.294.1632673752679; Sun, 26 Sep 2021 09:29:12 -0700 (PDT) Received: from neptune.. ([188.27.128.17]) by smtp.gmail.com with ESMTPSA id d15sm7468956ejo.4.2021.09.26.09.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 09:29:12 -0700 (PDT) From: Alexandru Ardelean To: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Cc: jic23@kernel.org, andreas@kemnade.info, Alexandru Ardelean Subject: [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function Date: Sun, 26 Sep 2021 19:28:59 +0300 Message-Id: <20210926162859.3567685-1-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This driver already hooks a similar unwind callback via devm_add_action_or_reset(). They pretty much do the same thing, so this change converts it to the devm_iio_map_array_register(). Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/rn5t618-adc.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iio/adc/rn5t618-adc.c b/drivers/iio/adc/rn5t618-adc.c index c56fccb2c8e1..7d891b4ea461 100644 --- a/drivers/iio/adc/rn5t618-adc.c +++ b/drivers/iio/adc/rn5t618-adc.c @@ -197,13 +197,6 @@ static struct iio_map rn5t618_maps[] = { { /* sentinel */ } }; -static void unregister_map(void *data) -{ - struct iio_dev *iio_dev = (struct iio_dev *) data; - - iio_map_array_unregister(iio_dev); -} - static int rn5t618_adc_probe(struct platform_device *pdev) { int ret; @@ -254,11 +247,7 @@ static int rn5t618_adc_probe(struct platform_device *pdev) return ret; } - ret = iio_map_array_register(iio_dev, rn5t618_maps); - if (ret < 0) - return ret; - - ret = devm_add_action_or_reset(adc->dev, unregister_map, iio_dev); + ret = devm_iio_map_array_register(adc->dev, iio_dev, rn5t618_maps); if (ret < 0) return ret; -- 2.31.1