xref: /openbmc/linux/drivers/firmware/efi/capsule-loader.c (revision 816ffd28002651a469e86d1118a225862e392ecd)
14febfb8dSArd Biesheuvel // SPDX-License-Identifier: GPL-2.0
265117f1aSKweh, Hock Leong /*
365117f1aSKweh, Hock Leong  * EFI capsule loader driver.
465117f1aSKweh, Hock Leong  *
565117f1aSKweh, Hock Leong  * Copyright 2015 Intel Corporation
665117f1aSKweh, Hock Leong  */
765117f1aSKweh, Hock Leong 
865117f1aSKweh, Hock Leong #define pr_fmt(fmt) "efi: " fmt
965117f1aSKweh, Hock Leong 
1065117f1aSKweh, Hock Leong #include <linux/kernel.h>
1165117f1aSKweh, Hock Leong #include <linux/module.h>
1265117f1aSKweh, Hock Leong #include <linux/miscdevice.h>
1365117f1aSKweh, Hock Leong #include <linux/highmem.h>
14c6625a31SSean Christopherson #include <linux/io.h>
1565117f1aSKweh, Hock Leong #include <linux/slab.h>
1665117f1aSKweh, Hock Leong #include <linux/mutex.h>
1765117f1aSKweh, Hock Leong #include <linux/efi.h>
186862e6adSAustin Christ #include <linux/vmalloc.h>
1965117f1aSKweh, Hock Leong 
2065117f1aSKweh, Hock Leong #define NO_FURTHER_WRITE_ACTION -1
2165117f1aSKweh, Hock Leong 
2265117f1aSKweh, Hock Leong /**
2365117f1aSKweh, Hock Leong  * efi_free_all_buff_pages - free all previous allocated buffer pages
2465117f1aSKweh, Hock Leong  * @cap_info: pointer to current instance of capsule_info structure
2565117f1aSKweh, Hock Leong  *
2665117f1aSKweh, Hock Leong  *	In addition to freeing buffer pages, it flags NO_FURTHER_WRITE_ACTION
2765117f1aSKweh, Hock Leong  *	to cease processing data in subsequent write(2) calls until close(2)
2865117f1aSKweh, Hock Leong  *	is called.
2965117f1aSKweh, Hock Leong  **/
efi_free_all_buff_pages(struct capsule_info * cap_info)3065117f1aSKweh, Hock Leong static void efi_free_all_buff_pages(struct capsule_info *cap_info)
3165117f1aSKweh, Hock Leong {
3265117f1aSKweh, Hock Leong 	while (cap_info->index > 0)
33f24c4d47SArd Biesheuvel 		__free_page(cap_info->pages[--cap_info->index]);
3465117f1aSKweh, Hock Leong 
3565117f1aSKweh, Hock Leong 	cap_info->index = NO_FURTHER_WRITE_ACTION;
3665117f1aSKweh, Hock Leong }
3765117f1aSKweh, Hock Leong 
__efi_capsule_setup_info(struct capsule_info * cap_info)383fabd628SArd Biesheuvel int __efi_capsule_setup_info(struct capsule_info *cap_info)
3965117f1aSKweh, Hock Leong {
4065117f1aSKweh, Hock Leong 	size_t pages_needed;
4165117f1aSKweh, Hock Leong 	int ret;
4265117f1aSKweh, Hock Leong 	void *temp_page;
4365117f1aSKweh, Hock Leong 
443fabd628SArd Biesheuvel 	pages_needed = ALIGN(cap_info->total_size, PAGE_SIZE) / PAGE_SIZE;
4565117f1aSKweh, Hock Leong 
4665117f1aSKweh, Hock Leong 	if (pages_needed == 0) {
4776ad9dffSArvind Yadav 		pr_err("invalid capsule size\n");
4865117f1aSKweh, Hock Leong 		return -EINVAL;
4965117f1aSKweh, Hock Leong 	}
5065117f1aSKweh, Hock Leong 
5165117f1aSKweh, Hock Leong 	/* Check if the capsule binary supported */
5282c3768bSArd Biesheuvel 	ret = efi_capsule_supported(cap_info->header.guid,
5382c3768bSArd Biesheuvel 				    cap_info->header.flags,
5482c3768bSArd Biesheuvel 				    cap_info->header.imagesize,
5565117f1aSKweh, Hock Leong 				    &cap_info->reset_type);
5665117f1aSKweh, Hock Leong 	if (ret) {
575dce14b9SJan Kiszka 		pr_err("capsule not supported\n");
5865117f1aSKweh, Hock Leong 		return ret;
5965117f1aSKweh, Hock Leong 	}
6065117f1aSKweh, Hock Leong 
6165117f1aSKweh, Hock Leong 	temp_page = krealloc(cap_info->pages,
6265117f1aSKweh, Hock Leong 			     pages_needed * sizeof(void *),
6365117f1aSKweh, Hock Leong 			     GFP_KERNEL | __GFP_ZERO);
647367633fSJan Kiszka 	if (!temp_page)
6565117f1aSKweh, Hock Leong 		return -ENOMEM;
6665117f1aSKweh, Hock Leong 
6765117f1aSKweh, Hock Leong 	cap_info->pages = temp_page;
6865117f1aSKweh, Hock Leong 
69f24c4d47SArd Biesheuvel 	temp_page = krealloc(cap_info->phys,
70f24c4d47SArd Biesheuvel 			     pages_needed * sizeof(phys_addr_t *),
71f24c4d47SArd Biesheuvel 			     GFP_KERNEL | __GFP_ZERO);
72f24c4d47SArd Biesheuvel 	if (!temp_page)
73f24c4d47SArd Biesheuvel 		return -ENOMEM;
74f24c4d47SArd Biesheuvel 
75f24c4d47SArd Biesheuvel 	cap_info->phys = temp_page;
76f24c4d47SArd Biesheuvel 
7765117f1aSKweh, Hock Leong 	return 0;
7865117f1aSKweh, Hock Leong }
7965117f1aSKweh, Hock Leong 
8065117f1aSKweh, Hock Leong /**
813fabd628SArd Biesheuvel  * efi_capsule_setup_info - obtain the efi capsule header in the binary and
823fabd628SArd Biesheuvel  *			    setup capsule_info structure
833fabd628SArd Biesheuvel  * @cap_info: pointer to current instance of capsule_info structure
843fabd628SArd Biesheuvel  * @kbuff: a mapped first page buffer pointer
853fabd628SArd Biesheuvel  * @hdr_bytes: the total received number of bytes for efi header
863fabd628SArd Biesheuvel  *
873fabd628SArd Biesheuvel  * Platforms with non-standard capsule update mechanisms can override
883fabd628SArd Biesheuvel  * this __weak function so they can perform any required capsule
893fabd628SArd Biesheuvel  * image munging. See quark_quirk_function() for an example.
903fabd628SArd Biesheuvel  **/
efi_capsule_setup_info(struct capsule_info * cap_info,void * kbuff,size_t hdr_bytes)913fabd628SArd Biesheuvel int __weak efi_capsule_setup_info(struct capsule_info *cap_info, void *kbuff,
923fabd628SArd Biesheuvel 				  size_t hdr_bytes)
933fabd628SArd Biesheuvel {
943fabd628SArd Biesheuvel 	/* Only process data block that is larger than efi header size */
953fabd628SArd Biesheuvel 	if (hdr_bytes < sizeof(efi_capsule_header_t))
963fabd628SArd Biesheuvel 		return 0;
973fabd628SArd Biesheuvel 
983fabd628SArd Biesheuvel 	memcpy(&cap_info->header, kbuff, sizeof(cap_info->header));
993fabd628SArd Biesheuvel 	cap_info->total_size = cap_info->header.imagesize;
1003fabd628SArd Biesheuvel 
1013fabd628SArd Biesheuvel 	return __efi_capsule_setup_info(cap_info);
1023fabd628SArd Biesheuvel }
1033fabd628SArd Biesheuvel 
1043fabd628SArd Biesheuvel /**
10565117f1aSKweh, Hock Leong  * efi_capsule_submit_update - invoke the efi_capsule_update API once binary
10665117f1aSKweh, Hock Leong  *			       upload done
10765117f1aSKweh, Hock Leong  * @cap_info: pointer to current instance of capsule_info structure
10865117f1aSKweh, Hock Leong  **/
efi_capsule_submit_update(struct capsule_info * cap_info)10965117f1aSKweh, Hock Leong static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
11065117f1aSKweh, Hock Leong {
111f24c4d47SArd Biesheuvel 	bool do_vunmap = false;
11265117f1aSKweh, Hock Leong 	int ret;
11365117f1aSKweh, Hock Leong 
114f24c4d47SArd Biesheuvel 	/*
115f24c4d47SArd Biesheuvel 	 * cap_info->capsule may have been assigned already by a quirk
116f24c4d47SArd Biesheuvel 	 * handler, so only overwrite it if it is NULL
117f24c4d47SArd Biesheuvel 	 */
118f24c4d47SArd Biesheuvel 	if (!cap_info->capsule) {
119f24c4d47SArd Biesheuvel 		cap_info->capsule = vmap(cap_info->pages, cap_info->index,
120f24c4d47SArd Biesheuvel 					 VM_MAP, PAGE_KERNEL);
121f24c4d47SArd Biesheuvel 		if (!cap_info->capsule)
122f24c4d47SArd Biesheuvel 			return -ENOMEM;
123f24c4d47SArd Biesheuvel 		do_vunmap = true;
124f24c4d47SArd Biesheuvel 	}
125f24c4d47SArd Biesheuvel 
126f24c4d47SArd Biesheuvel 	ret = efi_capsule_update(cap_info->capsule, cap_info->phys);
127f24c4d47SArd Biesheuvel 	if (do_vunmap)
128f24c4d47SArd Biesheuvel 		vunmap(cap_info->capsule);
12965117f1aSKweh, Hock Leong 	if (ret) {
1305dce14b9SJan Kiszka 		pr_err("capsule update failed\n");
13165117f1aSKweh, Hock Leong 		return ret;
13265117f1aSKweh, Hock Leong 	}
13365117f1aSKweh, Hock Leong 
13465117f1aSKweh, Hock Leong 	/* Indicate capsule binary uploading is done */
13565117f1aSKweh, Hock Leong 	cap_info->index = NO_FURTHER_WRITE_ACTION;
13683f0a7c7SShunyong Yang 
13783f0a7c7SShunyong Yang 	if (cap_info->header.flags & EFI_CAPSULE_PERSIST_ACROSS_RESET) {
13883f0a7c7SShunyong Yang 		pr_info("Successfully uploaded capsule file with reboot type '%s'\n",
1395dce14b9SJan Kiszka 			!cap_info->reset_type ? "RESET_COLD" :
14065117f1aSKweh, Hock Leong 			cap_info->reset_type == 1 ? "RESET_WARM" :
14165117f1aSKweh, Hock Leong 			"RESET_SHUTDOWN");
14283f0a7c7SShunyong Yang 	} else {
14383f0a7c7SShunyong Yang 		pr_info("Successfully processed capsule file\n");
14483f0a7c7SShunyong Yang 	}
14583f0a7c7SShunyong Yang 
14665117f1aSKweh, Hock Leong 	return 0;
14765117f1aSKweh, Hock Leong }
14865117f1aSKweh, Hock Leong 
14965117f1aSKweh, Hock Leong /**
15065117f1aSKweh, Hock Leong  * efi_capsule_write - store the capsule binary and pass it to
15165117f1aSKweh, Hock Leong  *		       efi_capsule_update() API
15265117f1aSKweh, Hock Leong  * @file: file pointer
15365117f1aSKweh, Hock Leong  * @buff: buffer pointer
15465117f1aSKweh, Hock Leong  * @count: number of bytes in @buff
15565117f1aSKweh, Hock Leong  * @offp: not used
15665117f1aSKweh, Hock Leong  *
15765117f1aSKweh, Hock Leong  *	Expectation:
15865117f1aSKweh, Hock Leong  *	- A user space tool should start at the beginning of capsule binary and
15965117f1aSKweh, Hock Leong  *	  pass data in sequentially.
16065117f1aSKweh, Hock Leong  *	- Users should close and re-open this file note in order to upload more
16165117f1aSKweh, Hock Leong  *	  capsules.
16265117f1aSKweh, Hock Leong  *	- After an error returned, user should close the file and restart the
16365117f1aSKweh, Hock Leong  *	  operation for the next try otherwise -EIO will be returned until the
16465117f1aSKweh, Hock Leong  *	  file is closed.
16565117f1aSKweh, Hock Leong  *	- An EFI capsule header must be located at the beginning of capsule
16665117f1aSKweh, Hock Leong  *	  binary file and passed in as first block data of write operation.
16765117f1aSKweh, Hock Leong  **/
efi_capsule_write(struct file * file,const char __user * buff,size_t count,loff_t * offp)16865117f1aSKweh, Hock Leong static ssize_t efi_capsule_write(struct file *file, const char __user *buff,
16965117f1aSKweh, Hock Leong 				 size_t count, loff_t *offp)
17065117f1aSKweh, Hock Leong {
171e0dc26c7SHeinrich Schuchardt 	int ret;
17265117f1aSKweh, Hock Leong 	struct capsule_info *cap_info = file->private_data;
17365117f1aSKweh, Hock Leong 	struct page *page;
17465117f1aSKweh, Hock Leong 	void *kbuff = NULL;
17565117f1aSKweh, Hock Leong 	size_t write_byte;
17665117f1aSKweh, Hock Leong 
17765117f1aSKweh, Hock Leong 	if (count == 0)
17865117f1aSKweh, Hock Leong 		return 0;
17965117f1aSKweh, Hock Leong 
18065117f1aSKweh, Hock Leong 	/* Return error while NO_FURTHER_WRITE_ACTION is flagged */
18165117f1aSKweh, Hock Leong 	if (cap_info->index < 0)
18265117f1aSKweh, Hock Leong 		return -EIO;
18365117f1aSKweh, Hock Leong 
18465117f1aSKweh, Hock Leong 	/* Only alloc a new page when previous page is full */
18565117f1aSKweh, Hock Leong 	if (!cap_info->page_bytes_remain) {
18665117f1aSKweh, Hock Leong 		page = alloc_page(GFP_KERNEL);
18765117f1aSKweh, Hock Leong 		if (!page) {
18865117f1aSKweh, Hock Leong 			ret = -ENOMEM;
18965117f1aSKweh, Hock Leong 			goto failed;
19065117f1aSKweh, Hock Leong 		}
19165117f1aSKweh, Hock Leong 
192f24c4d47SArd Biesheuvel 		cap_info->pages[cap_info->index] = page;
193f24c4d47SArd Biesheuvel 		cap_info->phys[cap_info->index] = page_to_phys(page);
19465117f1aSKweh, Hock Leong 		cap_info->page_bytes_remain = PAGE_SIZE;
195f24c4d47SArd Biesheuvel 		cap_info->index++;
1962a457fb3SArd Biesheuvel 	} else {
197f24c4d47SArd Biesheuvel 		page = cap_info->pages[cap_info->index - 1];
19865117f1aSKweh, Hock Leong 	}
19965117f1aSKweh, Hock Leong 
20065117f1aSKweh, Hock Leong 	kbuff = kmap(page);
20165117f1aSKweh, Hock Leong 	kbuff += PAGE_SIZE - cap_info->page_bytes_remain;
20265117f1aSKweh, Hock Leong 
20365117f1aSKweh, Hock Leong 	/* Copy capsule binary data from user space to kernel space buffer */
20465117f1aSKweh, Hock Leong 	write_byte = min_t(size_t, count, cap_info->page_bytes_remain);
20565117f1aSKweh, Hock Leong 	if (copy_from_user(kbuff, buff, write_byte)) {
20665117f1aSKweh, Hock Leong 		ret = -EFAULT;
20765117f1aSKweh, Hock Leong 		goto fail_unmap;
20865117f1aSKweh, Hock Leong 	}
20965117f1aSKweh, Hock Leong 	cap_info->page_bytes_remain -= write_byte;
21065117f1aSKweh, Hock Leong 
21165117f1aSKweh, Hock Leong 	/* Setup capsule binary info structure */
21282c3768bSArd Biesheuvel 	if (cap_info->header.headersize == 0) {
2133fabd628SArd Biesheuvel 		ret = efi_capsule_setup_info(cap_info, kbuff - cap_info->count,
21465117f1aSKweh, Hock Leong 					     cap_info->count + write_byte);
21565117f1aSKweh, Hock Leong 		if (ret)
21665117f1aSKweh, Hock Leong 			goto fail_unmap;
21765117f1aSKweh, Hock Leong 	}
21865117f1aSKweh, Hock Leong 
21965117f1aSKweh, Hock Leong 	cap_info->count += write_byte;
22065117f1aSKweh, Hock Leong 	kunmap(page);
22165117f1aSKweh, Hock Leong 
22265117f1aSKweh, Hock Leong 	/* Submit the full binary to efi_capsule_update() API */
22382c3768bSArd Biesheuvel 	if (cap_info->header.headersize > 0 &&
22465117f1aSKweh, Hock Leong 	    cap_info->count >= cap_info->total_size) {
22565117f1aSKweh, Hock Leong 		if (cap_info->count > cap_info->total_size) {
2265dce14b9SJan Kiszka 			pr_err("capsule upload size exceeded header defined size\n");
22765117f1aSKweh, Hock Leong 			ret = -EINVAL;
22865117f1aSKweh, Hock Leong 			goto failed;
22965117f1aSKweh, Hock Leong 		}
23065117f1aSKweh, Hock Leong 
23165117f1aSKweh, Hock Leong 		ret = efi_capsule_submit_update(cap_info);
23265117f1aSKweh, Hock Leong 		if (ret)
23365117f1aSKweh, Hock Leong 			goto failed;
23465117f1aSKweh, Hock Leong 	}
23565117f1aSKweh, Hock Leong 
23665117f1aSKweh, Hock Leong 	return write_byte;
23765117f1aSKweh, Hock Leong 
23865117f1aSKweh, Hock Leong fail_unmap:
23965117f1aSKweh, Hock Leong 	kunmap(page);
24065117f1aSKweh, Hock Leong failed:
24165117f1aSKweh, Hock Leong 	efi_free_all_buff_pages(cap_info);
24265117f1aSKweh, Hock Leong 	return ret;
24365117f1aSKweh, Hock Leong }
24465117f1aSKweh, Hock Leong 
24565117f1aSKweh, Hock Leong /**
24665117f1aSKweh, Hock Leong  * efi_capsule_release - called by file close
24765117f1aSKweh, Hock Leong  * @inode: not used
24865117f1aSKweh, Hock Leong  * @file: file pointer
24965117f1aSKweh, Hock Leong  *
25065117f1aSKweh, Hock Leong  *	We will not free successfully submitted pages since efi update
25165117f1aSKweh, Hock Leong  *	requires data to be maintained across system reboot.
25265117f1aSKweh, Hock Leong  **/
efi_capsule_release(struct inode * inode,struct file * file)25365117f1aSKweh, Hock Leong static int efi_capsule_release(struct inode *inode, struct file *file)
25465117f1aSKweh, Hock Leong {
25565117f1aSKweh, Hock Leong 	struct capsule_info *cap_info = file->private_data;
25665117f1aSKweh, Hock Leong 
2579cb636b5SHyunwoo Kim 	if (cap_info->index > 0 &&
2589cb636b5SHyunwoo Kim 	    (cap_info->header.headersize == 0 ||
2599cb636b5SHyunwoo Kim 	     cap_info->count < cap_info->total_size)) {
2609cb636b5SHyunwoo Kim 		pr_err("capsule upload not complete\n");
2619cb636b5SHyunwoo Kim 		efi_free_all_buff_pages(cap_info);
2629cb636b5SHyunwoo Kim 	}
2639cb636b5SHyunwoo Kim 
26465117f1aSKweh, Hock Leong 	kfree(cap_info->pages);
265f24c4d47SArd Biesheuvel 	kfree(cap_info->phys);
26665117f1aSKweh, Hock Leong 	kfree(file->private_data);
26765117f1aSKweh, Hock Leong 	file->private_data = NULL;
26865117f1aSKweh, Hock Leong 	return 0;
26965117f1aSKweh, Hock Leong }
27065117f1aSKweh, Hock Leong 
27165117f1aSKweh, Hock Leong /**
27265117f1aSKweh, Hock Leong  * efi_capsule_open - called by file open
27365117f1aSKweh, Hock Leong  * @inode: not used
27465117f1aSKweh, Hock Leong  * @file: file pointer
27565117f1aSKweh, Hock Leong  *
27665117f1aSKweh, Hock Leong  *	Will allocate each capsule_info memory for each file open call.
27765117f1aSKweh, Hock Leong  *	This provided the capability to support multiple file open feature
27865117f1aSKweh, Hock Leong  *	where user is not needed to wait for others to finish in order to
27965117f1aSKweh, Hock Leong  *	upload their capsule binary.
28065117f1aSKweh, Hock Leong  **/
efi_capsule_open(struct inode * inode,struct file * file)28165117f1aSKweh, Hock Leong static int efi_capsule_open(struct inode *inode, struct file *file)
28265117f1aSKweh, Hock Leong {
28365117f1aSKweh, Hock Leong 	struct capsule_info *cap_info;
28465117f1aSKweh, Hock Leong 
28565117f1aSKweh, Hock Leong 	cap_info = kzalloc(sizeof(*cap_info), GFP_KERNEL);
28665117f1aSKweh, Hock Leong 	if (!cap_info)
28765117f1aSKweh, Hock Leong 		return -ENOMEM;
28865117f1aSKweh, Hock Leong 
28965117f1aSKweh, Hock Leong 	cap_info->pages = kzalloc(sizeof(void *), GFP_KERNEL);
29065117f1aSKweh, Hock Leong 	if (!cap_info->pages) {
29165117f1aSKweh, Hock Leong 		kfree(cap_info);
29265117f1aSKweh, Hock Leong 		return -ENOMEM;
29365117f1aSKweh, Hock Leong 	}
29465117f1aSKweh, Hock Leong 
295*11aabd74SArnd Bergmann 	cap_info->phys = kzalloc(sizeof(phys_addr_t), GFP_KERNEL);
296f24c4d47SArd Biesheuvel 	if (!cap_info->phys) {
297f24c4d47SArd Biesheuvel 		kfree(cap_info->pages);
298f24c4d47SArd Biesheuvel 		kfree(cap_info);
299f24c4d47SArd Biesheuvel 		return -ENOMEM;
300f24c4d47SArd Biesheuvel 	}
301f24c4d47SArd Biesheuvel 
30265117f1aSKweh, Hock Leong 	file->private_data = cap_info;
30365117f1aSKweh, Hock Leong 
30465117f1aSKweh, Hock Leong 	return 0;
30565117f1aSKweh, Hock Leong }
30665117f1aSKweh, Hock Leong 
30765117f1aSKweh, Hock Leong static const struct file_operations efi_capsule_fops = {
30865117f1aSKweh, Hock Leong 	.owner = THIS_MODULE,
30965117f1aSKweh, Hock Leong 	.open = efi_capsule_open,
31065117f1aSKweh, Hock Leong 	.write = efi_capsule_write,
31165117f1aSKweh, Hock Leong 	.release = efi_capsule_release,
31265117f1aSKweh, Hock Leong 	.llseek = no_llseek,
31365117f1aSKweh, Hock Leong };
31465117f1aSKweh, Hock Leong 
31565117f1aSKweh, Hock Leong static struct miscdevice efi_capsule_misc = {
31665117f1aSKweh, Hock Leong 	.minor = MISC_DYNAMIC_MINOR,
31765117f1aSKweh, Hock Leong 	.name = "efi_capsule_loader",
31865117f1aSKweh, Hock Leong 	.fops = &efi_capsule_fops,
31965117f1aSKweh, Hock Leong };
32065117f1aSKweh, Hock Leong 
efi_capsule_loader_init(void)32165117f1aSKweh, Hock Leong static int __init efi_capsule_loader_init(void)
32265117f1aSKweh, Hock Leong {
32365117f1aSKweh, Hock Leong 	int ret;
32465117f1aSKweh, Hock Leong 
32565117f1aSKweh, Hock Leong 	if (!efi_enabled(EFI_RUNTIME_SERVICES))
32665117f1aSKweh, Hock Leong 		return -ENODEV;
32765117f1aSKweh, Hock Leong 
32865117f1aSKweh, Hock Leong 	ret = misc_register(&efi_capsule_misc);
32965117f1aSKweh, Hock Leong 	if (ret)
3305dce14b9SJan Kiszka 		pr_err("Unable to register capsule loader device\n");
33165117f1aSKweh, Hock Leong 
33265117f1aSKweh, Hock Leong 	return ret;
33365117f1aSKweh, Hock Leong }
33465117f1aSKweh, Hock Leong module_init(efi_capsule_loader_init);
33565117f1aSKweh, Hock Leong 
efi_capsule_loader_exit(void)33665117f1aSKweh, Hock Leong static void __exit efi_capsule_loader_exit(void)
33765117f1aSKweh, Hock Leong {
33865117f1aSKweh, Hock Leong 	misc_deregister(&efi_capsule_misc);
33965117f1aSKweh, Hock Leong }
34065117f1aSKweh, Hock Leong module_exit(efi_capsule_loader_exit);
34165117f1aSKweh, Hock Leong 
34265117f1aSKweh, Hock Leong MODULE_DESCRIPTION("EFI capsule firmware binary loader");
34365117f1aSKweh, Hock Leong MODULE_LICENSE("GPL v2");
344