Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2018 20:58:15 +0100
From:      Oliver Pinter <oliver.pinter@hardenedbsd.org>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   Re: svn commit: r331021 - stable/11/sys/dev/efidev
Message-ID:  <CAPQ4ffuYDANTuuzoj-E6mtPRbH2oBVEhFHCWYHd%2B5QWdd-wK7g@mail.gmail.com>
In-Reply-To: <201803151941.w2FJfQJd072993@repo.freebsd.org>
References:  <201803151941.w2FJfQJd072993@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/15/18, Kyle Evans <kevans@freebsd.org> wrote:
> Author: kevans
> Date: Thu Mar 15 19:41:26 2018
> New Revision: 331021
> URL: https://svnweb.freebsd.org/changeset/base/331021
>
> Log:
>   r322279: Don't create /dev/efi without EFI runtime
Hi!

Is this an MFC or a direct commit to 11-stable?


>
>   Turns out to be even simpler to just not create /dev/efi if we don't
>   have a efi runtime.
>
> Modified:
>   stable/11/sys/dev/efidev/efidev.c
> Directory Properties:
>   stable/11/   (props changed)
>
> Modified: stable/11/sys/dev/efidev/efidev.c
> ==============================================================================
> --- stable/11/sys/dev/efidev/efidev.c	Thu Mar 15 19:32:33 2018	(r331020)
> +++ stable/11/sys/dev/efidev/efidev.c	Thu Mar 15 19:41:26 2018	(r331021)
> @@ -39,28 +39,15 @@ __FBSDID("$FreeBSD$");
>  #include <machine/efi.h>
>  #include <sys/efiio.h>
>
> -static d_open_t efidev_open;
>  static d_ioctl_t efidev_ioctl;
>
>  static struct cdevsw efi_cdevsw = {
>  	.d_name = "efi",
>  	.d_version = D_VERSION,
> -	.d_open = efidev_open,
>  	.d_ioctl = efidev_ioctl,
>  };
>  	
>  static int
> -efidev_open(struct cdev *dev __unused, int oflags __unused,
> -    int devtype __unused, struct thread *td __unused)
> -{
> -	/*
> -	 * Only return success when we have an actual runtime to call.
> -	 */
> -
> -	return efi_rt_ok();
> -}
> -
> -static int
>  efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr,
>      int flags __unused, struct thread *td __unused)
>  {
> @@ -195,6 +182,11 @@ efidev_modevents(module_t m, int event, void *arg __un
>
>  	switch (event) {
>  	case MOD_LOAD:
> +		/*
> +		 * If we have no efi environment, then don't create the device.
> +		 */
> +		if (efi_rt_ok() != 0)
> +			return (0);
>  		make_dev_args_init(&mda);
>  		mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME;
>  		mda.mda_devsw = &efi_cdevsw;
> _______________________________________________
> svn-src-stable-11@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to
> "svn-src-stable-11-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPQ4ffuYDANTuuzoj-E6mtPRbH2oBVEhFHCWYHd%2B5QWdd-wK7g>