Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3339pxu; Wed, 6 Jan 2021 19:01:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZHtoFkGZyC5cc2VdlKuUXCIK5/KLkdBM3Yf4O37Mc3QPj/ci8NNPf07S0H7TJosB/kRiS X-Received: by 2002:a17:906:3711:: with SMTP id d17mr4830927ejc.121.1609988514513; Wed, 06 Jan 2021 19:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609988514; cv=none; d=google.com; s=arc-20160816; b=cczp4BlZ7F+DgFtX4lhTrcOLZDyn7V0hEhojp6jEYO3dgK/qjCPD+gNadaD1CdA2k2 7N+rw1jFO343AokOQf2bujQ3g+7kY42hn21rvqDobqRFGdFLe32QfYQGHIjt2gBsssXu uYoLsAq4vKHdDjhU1Jmj/gfWa5+MqrkifhCWUGoAo2yZGuVufaxonRdKDwHLq3Wwar/9 JJQ/tRGJqxndpXWtooP+X347/qq1aVU3SDXYVlJHXXrFij+uti9jQ/afwV2Yzq/JAszD BL4P6J5jivCBQBTh+CSca6u7zQPg5O71M52U7datGbsNC2PP2h0gzHn0tbSFnqUgrcye RLWg== 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=M28N0P5hDzLpDgJlVAVNR6bG1on+WpV10HCIOZozDlU=; b=FMGkAanY+Lv0LKqdThvcc5EcigslK7f6Pti2iSzaitXTPAHUnP8K8rWO2EeLd2ITBW dBDZP/pJ3D3yN83vekPpHpvzvkCzlfs8I86KggYjXZZ2O9K1eDntJ+pyPqQj+jappdUn pz7pt7FDVIpr9hf7t6d1UaJpjSKQIoyrOH0S0XXbGnLMRl/VYy2OyTIjgiqwffkLN4Vp IrS90v58ZDC1u09k5p2vsyrK0w+miEOqm0a/0USg0zLARNoJzaVrjiYBJfRgBm2cUFUr jEcqV2oV6RUPQX6q/aJIN/OP7XBNNiryrT07kZZ2W02VJ6MJ7pK6NJ94o6HmqJsyf3Wi BYPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KIQSZp96; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si1647857ejc.100.2021.01.06.19.01.28; Wed, 06 Jan 2021 19:01:54 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=KIQSZp96; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbhAGC7h (ORCPT + 99 others); Wed, 6 Jan 2021 21:59:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbhAGC7g (ORCPT ); Wed, 6 Jan 2021 21:59:36 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D0BEC0612EF; Wed, 6 Jan 2021 18:59:00 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id w6so2978780pfu.1; Wed, 06 Jan 2021 18:59:00 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=M28N0P5hDzLpDgJlVAVNR6bG1on+WpV10HCIOZozDlU=; b=KIQSZp96Vjw99b/hanudxfI0qagW+t/fgaoUTqOFuTe8mLMjcKmSHg79bCEeqZo/6H 9Bv+cjNnz1CHS24SgALV8GDcFl+z+66IQJQkvn6UuG4nJI5Q1FdirEwscv/5cER6vW0+ l5f63R1UBFKzMOqHgUaQGlIanJMOojIpe+EGHSyCFz64QHUNjz1O85X/l8SdVxx2UYOB p9kd3widyZ14mY5DikFRCTUjnJs2HoEWuJmiyBhWww1R+IUjgMDdGDwsSkLlp77c2mvt 4vgxeLpHu0E72UjNpL4wBhW34orgZexWALA/ZVA1zF7jQq08QjKsr6M7aw1C6UOcpZnd yv7Q== 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=M28N0P5hDzLpDgJlVAVNR6bG1on+WpV10HCIOZozDlU=; b=JzghGjQ6XMUBPcx2NamNByA7+sP5EIwI/o4sqsbNmnReDvtz3RMh6RFb2VsWSzl8Xf EeZS+n3GJ9N1i4c/j61DbXMXkVVNbFBfZxfGb/osZRhqgdRqiYX3R3VwJiKbarmwqhH7 y+k7aFCs2Q2jopuDYO46oYyp7M4rbnaLoRTsMNCAwO0aVgX7cwHaeKHm9tkIvrMrgzV8 8juWxtDWbZKCzwvHTPGZq/aoB23ThVLivSDGNenLHalStuayBFY9N7haFzxj+OHLsINI lh1OUBUerMwEvgCbCLnG+eF1/TwcKUdAVOLsKATDX39iNNyTsoUzdzFuFxHOoXkD7GZC 891Q== X-Gm-Message-State: AOAM530Ze08NnCikRh/B5ql1MJUHwIzMtTGlZWi+I1xsPx6CtZs5blQ7 hqOHbHIOmR28nK6pq3dOzHtzrdj0RRyl2w== X-Received: by 2002:a62:c504:0:b029:1a5:b198:18dc with SMTP id j4-20020a62c5040000b02901a5b19818dcmr6897705pfg.79.1609988339225; Wed, 06 Jan 2021 18:58:59 -0800 (PST) Received: from sol.lan (106-69-181-20.dyn.iinet.net.au. [106.69.181.20]) by smtp.gmail.com with ESMTPSA id x16sm3900120pfp.62.2021.01.06.18.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 18:58:58 -0800 (PST) From: Kent Gibson To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kselftest@vger.kernel.org, bgolaszewski@baylibre.com, linus.walleij@linaro.org, shuah@kernel.org, bamv2005@gmail.com Cc: Kent Gibson Subject: [PATCH v2 5/7] tools: gpio: remove uAPI v1 code no longer used by selftests Date: Thu, 7 Jan 2021 10:57:29 +0800 Message-Id: <20210107025731.226017-6-warthog618@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107025731.226017-1-warthog618@gmail.com> References: <20210107025731.226017-1-warthog618@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gpio-mockup-chardev helper has been obsoleted and removed, so also remove the tools/gpio code that it, and nothing else, was using. Signed-off-by: Kent Gibson Acked-by: Linus Walleij --- tools/gpio/gpio-utils.c | 89 ----------------------------------------- tools/gpio/gpio-utils.h | 6 --- 2 files changed, 95 deletions(-) diff --git a/tools/gpio/gpio-utils.c b/tools/gpio/gpio-utils.c index 37187e056c8b..1639b4d832cd 100644 --- a/tools/gpio/gpio-utils.c +++ b/tools/gpio/gpio-utils.c @@ -32,74 +32,6 @@ * following api will request gpio lines, do the operation and then * release these lines. */ -/** - * gpiotools_request_linehandle() - request gpio lines in a gpiochip - * @device_name: The name of gpiochip without prefix "/dev/", - * such as "gpiochip0" - * @lines: An array desired lines, specified by offset - * index for the associated GPIO device. - * @num_lines: The number of lines to request. - * @flag: The new flag for requsted gpio. Reference - * "linux/gpio.h" for the meaning of flag. - * @data: Default value will be set to gpio when flag is - * GPIOHANDLE_REQUEST_OUTPUT. - * @consumer_label: The name of consumer, such as "sysfs", - * "powerkey". This is useful for other users to - * know who is using. - * - * Request gpio lines through the ioctl provided by chardev. User - * could call gpiotools_set_values() and gpiotools_get_values() to - * read and write respectively through the returned fd. Call - * gpiotools_release_linehandle() to release these lines after that. - * - * Return: On success return the fd; - * On failure return the errno. - */ -int gpiotools_request_linehandle(const char *device_name, unsigned int *lines, - unsigned int num_lines, unsigned int flag, - struct gpiohandle_data *data, - const char *consumer_label) -{ - struct gpiohandle_request req; - char *chrdev_name; - int fd; - int i; - int ret; - - ret = asprintf(&chrdev_name, "/dev/%s", device_name); - if (ret < 0) - return -ENOMEM; - - fd = open(chrdev_name, 0); - if (fd == -1) { - ret = -errno; - fprintf(stderr, "Failed to open %s, %s\n", - chrdev_name, strerror(errno)); - goto exit_free_name; - } - - for (i = 0; i < num_lines; i++) - req.lineoffsets[i] = lines[i]; - - req.flags = flag; - strcpy(req.consumer_label, consumer_label); - req.lines = num_lines; - if (flag & GPIOHANDLE_REQUEST_OUTPUT) - memcpy(req.default_values, data, sizeof(req.default_values)); - - ret = ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, &req); - if (ret == -1) { - ret = -errno; - fprintf(stderr, "Failed to issue %s (%d), %s\n", - "GPIO_GET_LINEHANDLE_IOCTL", ret, strerror(errno)); - } - - if (close(fd) == -1) - perror("Failed to close GPIO character device file"); -exit_free_name: - free(chrdev_name); - return ret < 0 ? ret : req.fd; -} /** * gpiotools_request_line() - request gpio lines in a gpiochip @@ -215,27 +147,6 @@ int gpiotools_get_values(const int fd, struct gpio_v2_line_values *values) return ret; } -/** - * gpiotools_release_linehandle(): Release the line(s) of gpiochip - * @fd: The fd returned by - * gpiotools_request_linehandle(). - * - * Return: On success return 0; - * On failure return the errno. - */ -int gpiotools_release_linehandle(const int fd) -{ - int ret; - - ret = close(fd); - if (ret == -1) { - perror("Failed to close GPIO LINEHANDLE device file"); - ret = -errno; - } - - return ret; -} - /** * gpiotools_release_line(): Release the line(s) of gpiochip * @fd: The fd returned by diff --git a/tools/gpio/gpio-utils.h b/tools/gpio/gpio-utils.h index 6c69a9f1c253..8af7c8ee19ce 100644 --- a/tools/gpio/gpio-utils.h +++ b/tools/gpio/gpio-utils.h @@ -24,12 +24,6 @@ static inline int check_prefix(const char *str, const char *prefix) strncmp(str, prefix, strlen(prefix)) == 0; } -int gpiotools_request_linehandle(const char *device_name, unsigned int *lines, - unsigned int num_lines, unsigned int flag, - struct gpiohandle_data *data, - const char *consumer_label); -int gpiotools_release_linehandle(const int fd); - int gpiotools_request_line(const char *device_name, unsigned int *lines, unsigned int num_lines, -- 2.30.0