Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2018 20:01:39 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329272 - stable/11/sys/dev/spibus
Message-ID:  <201802142001.w1EK1doJ092027@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Wed Feb 14 20:01:39 2018
New Revision: 329272
URL: https://svnweb.freebsd.org/changeset/base/329272

Log:
  MFC r308895 by manu:
  
  Enable the use of spigen on FDT platform

Modified:
  stable/11/sys/dev/spibus/spigen.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/spibus/spigen.c
==============================================================================
--- stable/11/sys/dev/spibus/spigen.c	Wed Feb 14 18:43:50 2018	(r329271)
+++ stable/11/sys/dev/spibus/spigen.c	Wed Feb 14 20:01:39 2018	(r329272)
@@ -25,6 +25,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_platform.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
@@ -65,6 +67,17 @@ struct spigen_softc {
 	int sc_debug;
 };
 
+#ifdef FDT
+static void
+spigen_identify(driver_t *driver, device_t parent)
+{
+	if (device_find_child(parent, "spigen", -1) != NULL)
+		return;
+	if (BUS_ADD_CHILD(parent, 0, "spigen", -1) == NULL)
+		device_printf(parent, "add child failed\n");
+}
+#endif
+
 static int
 spigen_probe(device_t dev)
 {
@@ -393,6 +406,9 @@ static devclass_t spigen_devclass;
 
 static device_method_t spigen_methods[] = {
 	/* Device interface */
+#ifdef FDT
+	DEVMETHOD(device_identify,	spigen_identify),
+#endif
 	DEVMETHOD(device_probe,		spigen_probe),
 	DEVMETHOD(device_attach,	spigen_attach),
 	DEVMETHOD(device_detach,	spigen_detach),



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