From patchwork Thu Aug 30 15:44:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rossak X-Patchwork-Id: 10582175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3298014BD for ; Thu, 30 Aug 2018 15:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 207692C0E2 for ; Thu, 30 Aug 2018 15:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 132072C0E9; Thu, 30 Aug 2018 15:54:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 966AF2C0E2 for ; Thu, 30 Aug 2018 15:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=a6b9ak5frcHwrrsuTmiInaSpGkiTomMYrbEFJmiotGE=; b=SmJlUEaVxejyTLqyK5DFK4cVn/ Q2QSyr++yRlQQlZJf4QTgUqTbCq7tRhP199oBuEp+0KvB7lahmDzwITCbHB3F0n197dPStjoqD29t zJKSkXDOq9yOO/EAiuyPzFAIwNDVgl7ZT7yRAPb/YbrkcWD/hBcM8je+/xOhHIxbog7X+5CBhjprA /WxIjM4ygyJEkvYQeQa/lA4Vb64moVHY6YN64jotYzRRueWVuphNE7xMLDYm4sPQKBP2HZc3gNt23 OXBSHQUXkqrs3bcB7Niq1zl3kiw3vSq94bKm/L1VxTzhWQiz8J1h1EYMGTNC3kl6yH0GvN64GEKXm Zju04Rzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvPGf-0006Dy-QY; Thu, 30 Aug 2018 15:53:57 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvP8Z-0001af-G0 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2018 15:45:41 +0000 Received: by mail-wr1-x444.google.com with SMTP id n2-v6so8510163wrw.7 for ; Thu, 30 Aug 2018 08:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tFfQ9c8YXGxQQwqrjR6oys9dfg5aGNdXZejyyuPf1vg=; b=YnVLxEatWQEYx0jHq0IAvzD9z53G/4ynMvpPRtxkaxEI3G1r7xDvs4lBRl8BKK8sVC D5/DAi1jGWwWcEyBNzp2KrXMslYIwz/nCM/rpdE77V3LZ+YVPFOs8xrO6jvk/axBNTTw MkKG3wT8DM5RE9G3TSon4Jf/EwCE1MGW4cJblbzEUbgBxcJrZYnTGlhzAx5o97g4csS/ 6ctjYf3028zCgUg9aOdMQrqIudXpw4GRZzkp9JzOry0Hkx4XDWR4vMbEIfnI+BuoyGGp A1UfSjhlocjJ3Pad4GikQ/RED085n+gCm7azaCschaGpWhG+I6cg5GmnV1VqBGAWMNQn qEoA== 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; bh=tFfQ9c8YXGxQQwqrjR6oys9dfg5aGNdXZejyyuPf1vg=; b=ENMRe8t4HfFFLLrRT1LKgbmeEaWgrk+kqD/RnVWU4HZy6IpR5JAZrcK5BRaWgTjGEL MDqaCdoP/E0+ncnvI0FMlTk9RcKO+gy+XeUL2iE+kzA+CnbymMtF4BlZGgamOf0oc7uh e3p5y2oG+tWT1oqSEI6GUeeH80blQnwi3X8Tke2HzE8dZ3fsucXY/phCD+5RpAo5Ki1s d1OP4A/klO7dXl/dO5BjTOj526Y9yv3a0w7TI9yZzfYQuOygMDRB05mvPSzrDBiPZAZ6 RiYLE9UJBEGJnMhEsPW0F6l6NEw+O05/cQ+zljh6IERksoAhAJXmg06cT1qVfWT5Fc/Q c5xg== X-Gm-Message-State: APzg51BR519ogGMpIvatopDdbv+CUpSHmErQ9NQjWlr5Ut75//LyrrTB 8Q1bYaGlFzWDHt9yK0t/aA0= X-Google-Smtp-Source: ANB0Vda7gM6oXRTKYIaCexUkUiShe9Jn2An6YoMbuiIqmF7diafLDl42iCOez3qQIYf63qK/9HpN2A== X-Received: by 2002:a5d:4512:: with SMTP id s18-v6mr8486837wrq.82.1535643926751; Thu, 30 Aug 2018 08:45:26 -0700 (PDT) Received: from debian-hp.wlan.uni-ulm.de (eduroam170-020.wlan.uni-ulm.de. [134.60.170.20]) by smtp.gmail.com with ESMTPSA id j20-v6sm1362759wmh.9.2018.08.30.08.45.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 08:45:26 -0700 (PDT) From: Philipp Rossak To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@bootlin.com, wens@csie.org, linux@armlinux.org.uk, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, eugen.hristev@microchip.com, rdunlap@infradead.org, vilhelm.gray@gmail.com, clabbe.montjoie@gmail.com, quentin.schulz@bootlin.com, geert+renesas@glider.be, lukas@wunner.de, icenowy@aosc.io, arnd@arndb.de, broonie@kernel.org, arnaud.pouliquen@st.com Subject: [PATCH v3 07/30] iio: adc: remove mfd_probe & sunwi_irq_init function Date: Thu, 30 Aug 2018 17:44:55 +0200 Message-Id: <20180830154518.29507-8-embed3d@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180830154518.29507-1-embed3d@gmail.com> References: <20180830154518.29507-1-embed3d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_084535_574921_87D8634F X-CRM114-Status: GOOD ( 19.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In the previous commit we removed the function call, now we remove the unused functions. Signed-off-by: Philipp Rossak --- drivers/iio/adc/sun4i-gpadc-iio.c | 126 -------------------------------------- 1 file changed, 126 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index d6f00d3b802d..f787442a9e5f 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -431,55 +431,6 @@ static const struct dev_pm_ops sun4i_gpadc_pm_ops = { .runtime_resume = &sun4i_gpadc_runtime_resume, }; -static int sun4i_irq_init(struct platform_device *pdev, const char *name, - irq_handler_t handler, const char *devname, - unsigned int *irq, atomic_t *atomic) -{ - int ret; - struct sun4i_gpadc_dev *mfd_dev = dev_get_drvdata(pdev->dev.parent); - struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(&pdev->dev)); - - /* - * Once the interrupt is activated, the IP continuously performs - * conversions thus throws interrupts. The interrupt is activated right - * after being requested but we want to control when these interrupts - * occur thus we disable it right after being requested. However, an - * interrupt might occur between these two instructions and we have to - * make sure that does not happen, by using atomic flags. We set the - * flag before requesting the interrupt and unset it right after - * disabling the interrupt. When an interrupt occurs between these two - * instructions, reading the atomic flag will tell us to ignore the - * interrupt. - */ - atomic_set(atomic, 1); - - ret = platform_get_irq_byname(pdev, name); - if (ret < 0) { - dev_err(&pdev->dev, "no %s interrupt registered\n", name); - return ret; - } - - ret = regmap_irq_get_virq(mfd_dev->regmap_irqc, ret); - if (ret < 0) { - dev_err(&pdev->dev, "failed to get virq for irq %s\n", name); - return ret; - } - - *irq = ret; - ret = devm_request_any_context_irq(&pdev->dev, *irq, handler, 0, - devname, info); - if (ret < 0) { - dev_err(&pdev->dev, "could not request %s interrupt: %d\n", - name, ret); - return ret; - } - - disable_irq(*irq); - atomic_set(atomic, 0); - - return 0; -} - static const struct of_device_id sun4i_gpadc_of_id[] = { { .compatible = "allwinner,sun8i-a33-ths", @@ -523,83 +474,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, return 0; } -static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, - struct iio_dev *indio_dev) -{ - struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - struct sun4i_gpadc_dev *sun4i_gpadc_dev = - dev_get_drvdata(pdev->dev.parent); - int ret; - - info->no_irq = false; - info->regmap = sun4i_gpadc_dev->regmap; - - indio_dev->num_channels = ARRAY_SIZE(sun4i_gpadc_channels); - indio_dev->channels = sun4i_gpadc_channels; - - info->data = (struct gpadc_data *)platform_get_device_id(pdev)->driver_data; - - /* - * Since the controller needs to be in touchscreen mode for its thermal - * sensor to operate properly, and that switching between the two modes - * needs a delay, always registering in the thermal framework will - * significantly slow down the conversion rate of the ADCs. - * - * Therefore, instead of depending on THERMAL_OF in Kconfig, we only - * register the sensor if that option is enabled, eventually leaving - * that choice to the user. - */ - - if (IS_ENABLED(CONFIG_THERMAL_OF)) { - /* - * This driver is a child of an MFD which has a node in the DT - * but not its children, because of DT backward compatibility - * for A10, A13 and A31 SoCs. Therefore, the resulting devices - * of this driver do not have an of_node variable. - * However, its parent (the MFD driver) has an of_node variable - * and since devm_thermal_zone_of_sensor_register uses its first - * argument to match the phandle defined in the node of the - * thermal driver with the of_node of the device passed as first - * argument and the third argument to call ops from - * thermal_zone_of_device_ops, the solution is to use the parent - * device as first argument to match the phandle with its - * of_node, and the device from this driver as third argument to - * return the temperature. - */ - info->sensor_device = pdev->dev.parent; - } else { - indio_dev->num_channels = - ARRAY_SIZE(sun4i_gpadc_channels_no_temp); - indio_dev->channels = sun4i_gpadc_channels_no_temp; - } - - if (IS_ENABLED(CONFIG_THERMAL_OF)) { - ret = sun4i_irq_init(pdev, "TEMP_DATA_PENDING", - sun4i_gpadc_temp_data_irq_handler, - "temp_data", &info->temp_data_irq, - &info->ignore_temp_data_irq); - if (ret < 0) - return ret; - } - - ret = sun4i_irq_init(pdev, "FIFO_DATA_PENDING", - sun4i_gpadc_fifo_data_irq_handler, "fifo_data", - &info->fifo_data_irq, &info->ignore_fifo_data_irq); - if (ret < 0) - return ret; - - if (IS_ENABLED(CONFIG_THERMAL_OF)) { - ret = iio_map_array_register(indio_dev, sun4i_gpadc_hwmon_maps); - if (ret < 0) { - dev_err(&pdev->dev, - "failed to register iio map array\n"); - return ret; - } - } - - return 0; -} - static int sun4i_gpadc_probe(struct platform_device *pdev) { struct sun4i_gpadc_iio *info;