Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 2014 14:02:39 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r261654 - stable/9/sys/dev/drm2
Message-ID:  <201402091402.s19E2dL2047816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Feb  9 14:02:39 2014
New Revision: 261654
URL: http://svnweb.freebsd.org/changeset/base/261654

Log:
  MFC r254819:
  
  drm: Don't delete already deleted iicbus child from drm_iic_dp_aux
  
  The iic_dp_aux_detach callback is therefore useless: it's replaced by
  bus_generic_detach. This fixes a "General protection fault" panic during
  second (incorrect) deletion of the child.
  
  Tested by:	kwm@
  Reviewed by:	ray@

Modified:
  stable/9/sys/dev/drm2/drm_dp_iic_helper.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/drm2/drm_dp_iic_helper.c
==============================================================================
--- stable/9/sys/dev/drm2/drm_dp_iic_helper.c	Sun Feb  9 13:56:37 2014	(r261653)
+++ stable/9/sys/dev/drm2/drm_dp_iic_helper.c	Sun Feb  9 14:02:39 2014	(r261654)
@@ -216,22 +216,6 @@ iic_dp_aux_attach(device_t idev)
 	return (0);
 }
 
-static int
-iic_dp_aux_detach(device_t idev)
-{
-	struct iic_dp_aux_data *aux_data;
-	device_t port;
-
-	aux_data = device_get_softc(idev);
-
-	port = aux_data->port;
-	bus_generic_detach(idev);
-	if (port != NULL)
-		device_delete_child(idev, port);
-
-	return (0);
-}
-
 int
 iic_dp_aux_add_bus(device_t dev, const char *name,
     int (*ch)(device_t idev, int mode, uint8_t write_byte, uint8_t *read_byte),
@@ -277,7 +261,7 @@ iic_dp_aux_add_bus(device_t dev, const c
 static device_method_t drm_iic_dp_aux_methods[] = {
 	DEVMETHOD(device_probe,		iic_dp_aux_probe),
 	DEVMETHOD(device_attach,	iic_dp_aux_attach),
-	DEVMETHOD(device_detach,	iic_dp_aux_detach),
+	DEVMETHOD(device_detach,	bus_generic_detach),
 	DEVMETHOD(iicbus_reset,		iic_dp_aux_reset),
 	DEVMETHOD(iicbus_transfer,	iic_dp_aux_xfer),
 	DEVMETHOD_END



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