Date: Tue, 03 Sep 2019 14:06:34 -0000 From: Marcin Wojtas <mw@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345874 - stable/12/sys/arm64/arm64 Message-ID: <201904041202.x34C2n1m063115@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mw Date: Thu Apr 4 12:02:48 2019 New Revision: 345874 URL: https://svnweb.freebsd.org/changeset/base/345874 Log: MFC r345373: Add bus_release_resource() method to nexus on arm64 Submitted by: Michal Krawczyk <mk@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/sys/arm64/arm64/nexus.c Modified: stable/12/sys/arm64/arm64/nexus.c ============================================================================== --- stable/12/sys/arm64/arm64/nexus.c Thu Apr 4 12:02:41 2019 (r345873) +++ stable/12/sys/arm64/arm64/nexus.c Thu Apr 4 12:02:48 2019 (r345874) @@ -113,6 +113,8 @@ static int nexus_set_resource(device_t, device_t, int, rman_res_t, rman_res_t); static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_release_resource(device_t, device_t, int, int, + struct resource *); static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); @@ -137,6 +139,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), @@ -268,6 +271,20 @@ nexus_alloc_resource(device_t bus, device_t child, int } return (rv); +} + +static int +nexus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + int error; + + if (rman_get_flags(res) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, res); + if (error) + return (error); + } + return (rman_release_resource(res)); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904041202.x34C2n1m063115>