From nobody Fri Jul 04 20:26:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bYlX53DNqz60l1Y; Fri, 04 Jul 2025 20:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYlX529Fyz3tFP; Fri, 04 Jul 2025 20:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751660773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kKsp+vrEdbYrupJSWpB3AMi+zeByboxq5TVQOi4dz4=; b=Yt1jqkDtNKVOoL5w6K0aYF71/yUPicjfMoxxAWPQRhDVWLjJbczAuODGTl270+ZNaFgExT 4pZmGk6SsH2jiKbZC8nxKGL7G85zq8dV6VQ1lJrIwTRVC4F7KLsoCpqOe1Tfc+6KlS4A6F 4mzuttamEffbD7fh53TOVP4qAhCz/owfj9NY3yS6E+jwcGuXEM4OZBajXCDMt/tq0YqDk3 FPlaOVXt36FrJ0z+i7UR6zSMCf+6l0L2YUieWNbN5lPQ4miM3Y13b+4YG7rwgfh9vRcmGK s5Y1YiXdQgP85wzfFj0BugmCtsvYGIruwZRF0CI9acYLzgEKzWUCsvoRhLqKLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751660773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kKsp+vrEdbYrupJSWpB3AMi+zeByboxq5TVQOi4dz4=; b=lv8EnaT8fZlWx95NzAyRaI5DpRB0SA+bgcVVgDSqwGevKgb3b9pJTjOKBs7zNwDrQM212o tQf9Wg3e8xQGQsxyvAURT8f7/nCdaDSRC/3QTfME4RwvYKBUDLjd39jQVFGNCpbWSQOTKD 9vdcKihXeqNrfcmKT6F39Ayd3A3HTf2SlQbj3BmiJgFGHqJ8uEHI5o4xAYen1FbKjMx0BK Jk2molLar7gGub99QrekBd9c9EHo5z1bKKJGil64mknKWxDcwaOcMMQADQQl05sJ8OyOM7 RuKdS6/WtjlsRz/Sf1ImUzh2P8AO1xvj83W0Fu0FdbrGqlW4+jU86u7gazsg+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751660773; a=rsa-sha256; cv=none; b=n8Ob4IHqWYEw0TPIKzKbD2acMV/VAoIWcMzjYFfMfe4wyEFnKw/KIKwL532OzsGFfA3COr X/Hx07GVf6A75UxkhPTXzeX13MKn0xh2ImYtorAfWKdmzsvHZLDjFi2Xh9J0lcMioXPzcc BFw+qUhpwKBbGayZXV4QJKC1nJ/UqTfLLwJhb3Eb+hxWck0Hed+eDwd3ZUZSnA5NStXvcP oZAHz8SmcnQzXIVrgCqMw9Erf044/7Vxbx/lKJfS8YYti5I4x65Nkj6bysA2qS3fSzbuWd QEHDFvckWG0On6iAsCI/IwTpu6K8wKkRhIa6+ALjSLBHXNWqtrC6YpvX93VrHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bYlX51bDvz14gW; Fri, 04 Jul 2025 20:26:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564KQDLx096968; Fri, 4 Jul 2025 20:26:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564KQD3P096965; Fri, 4 Jul 2025 20:26:13 GMT (envelope-from git) Date: Fri, 4 Jul 2025 20:26:13 GMT Message-Id: <202507042026.564KQD3P096965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: 9c2509f831e8 - main - gpio: hide internal gpiobus symbols List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c2509f831e8194ef8c30aa5d839a7eb2197ff7f Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=9c2509f831e8194ef8c30aa5d839a7eb2197ff7f commit 9c2509f831e8194ef8c30aa5d839a7eb2197ff7f Author: Ahmad Khalifa AuthorDate: 2025-07-04 20:03:34 +0000 Commit: Ahmad Khalifa CommitDate: 2025-07-04 20:24:31 +0000 gpio: hide internal gpiobus symbols Move functions and variables internal to gpiobus to their own header to avoid namespace pollution and misuse. Reviewed by: wulf, imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50872 --- sys/dev/gpio/acpi_gpiobus.c | 1 + sys/dev/gpio/gpiobus.c | 1 + sys/dev/gpio/gpiobus_internal.h | 47 +++++++++++++++++++++++++++++++++++++++++ sys/dev/gpio/gpiobusvar.h | 14 ------------ sys/dev/gpio/ofw_gpiobus.c | 1 + 5 files changed, 50 insertions(+), 14 deletions(-) diff --git a/sys/dev/gpio/acpi_gpiobus.c b/sys/dev/gpio/acpi_gpiobus.c index 2987af634866..f9468e0deda0 100644 --- a/sys/dev/gpio/acpi_gpiobus.c +++ b/sys/dev/gpio/acpi_gpiobus.c @@ -36,6 +36,7 @@ #include #include +#include #include "gpiobus_if.h" diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 84980f3d6546..ab7f13177969 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -39,6 +39,7 @@ #include #include +#include #include "gpiobus_if.h" diff --git a/sys/dev/gpio/gpiobus_internal.h b/sys/dev/gpio/gpiobus_internal.h new file mode 100644 index 000000000000..de3f57663132 --- /dev/null +++ b/sys/dev/gpio/gpiobus_internal.h @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2009 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef __GPIOBUS_INTERNAL_H__ +#define __GPIOBUS_INTERNAL_H__ + +/* + * Functions shared between gpiobus and other bus classes that derive from it; + * these should not be called directly by other drivers. + */ +int gpiobus_attach(device_t); +int gpiobus_detach(device_t); +int gpiobus_init_softc(device_t); +int gpiobus_alloc_ivars(struct gpiobus_ivar *); +void gpiobus_free_ivars(struct gpiobus_ivar *); +int gpiobus_read_ivar(device_t, device_t, int, uintptr_t *); +int gpiobus_acquire_pin(device_t, uint32_t); +void gpiobus_release_pin(device_t, uint32_t); + +extern driver_t gpiobus_driver; +#endif diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index 972e1f196399..7f504236a774 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -169,23 +169,9 @@ int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags); struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode); -/* - * Functions shared between gpiobus and other bus classes that derive from it; - * these should not be called directly by other drivers. - */ int gpio_check_flags(uint32_t, uint32_t); device_t gpiobus_add_bus(device_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); -int gpiobus_attach(device_t); -int gpiobus_detach(device_t); -int gpiobus_init_softc(device_t); -int gpiobus_alloc_ivars(struct gpiobus_ivar *); -void gpiobus_free_ivars(struct gpiobus_ivar *); -int gpiobus_read_ivar(device_t, device_t, int, uintptr_t *); -int gpiobus_acquire_pin(device_t, uint32_t); -void gpiobus_release_pin(device_t, uint32_t); - -extern driver_t gpiobus_driver; #endif /* __GPIOBUS_H__ */ diff --git a/sys/dev/gpio/ofw_gpiobus.c b/sys/dev/gpio/ofw_gpiobus.c index 32dc5b55e698..fc5fb03d6824 100644 --- a/sys/dev/gpio/ofw_gpiobus.c +++ b/sys/dev/gpio/ofw_gpiobus.c @@ -36,6 +36,7 @@ #include #include +#include #include #include "gpiobus_if.h"