Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 2019 09:23:54 +0000 (UTC)
From:      Andriy Gapon <avg@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: r354063 - stable/12/sys/dev/gpio
Message-ID:  <201910250923.x9P9Nsme008145@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Oct 25 09:23:53 2019
New Revision: 354063
URL: https://svnweb.freebsd.org/changeset/base/354063

Log:
  MFC r353727: gpioiic: add the detach method

Modified:
  stable/12/sys/dev/gpio/gpioiic.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/gpio/gpioiic.c
==============================================================================
--- stable/12/sys/dev/gpio/gpioiic.c	Fri Oct 25 09:19:15 2019	(r354062)
+++ stable/12/sys/dev/gpio/gpioiic.c	Fri Oct 25 09:23:53 2019	(r354063)
@@ -143,6 +143,15 @@ gpioiic_attach(device_t dev)
 	return (0);
 }
 
+static int
+gpioiic_detach(device_t dev)
+{
+
+	bus_generic_detach(dev);
+	device_delete_children(dev);
+	return (0);
+}
+
 /*
  * Reset bus by setting SDA first and then SCL. 
  * Must always be called with gpio bus locked.
@@ -241,7 +250,7 @@ static device_method_t gpioiic_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		gpioiic_probe),
 	DEVMETHOD(device_attach,	gpioiic_attach),
-	DEVMETHOD(device_detach,	bus_generic_detach),
+	DEVMETHOD(device_detach,	gpioiic_detach),
 
 	/* iicbb interface */
 	DEVMETHOD(iicbb_setsda,		gpioiic_setsda),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910250923.x9P9Nsme008145>