From owner-svn-src-stable@freebsd.org Wed Feb 14 20:01:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCFEF1BC51; Wed, 14 Feb 2018 20:01:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDAC76A43C; Wed, 14 Feb 2018 20:01:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8B2E14752; Wed, 14 Feb 2018 20:01:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1EK1dg0092028; Wed, 14 Feb 2018 20:01:39 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1EK1doJ092027; Wed, 14 Feb 2018 20:01:39 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201802142001.w1EK1doJ092027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 14 Feb 2018 20:01:39 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/dev/spibus X-SVN-Commit-Revision: 329272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 20:01:40 -0000 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 __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -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),