Re: [PATCH v2 16/21] usb/gadget: f_mass_storage: use fsg_common_run_thread in fsg_common_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 19 2013, Andrzej Pietrasiewicz wrote:
> fsg_common_init is a lengthy function. Now there are helper functions
> which cover all parts of it. Use them.
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

> ---
>  drivers/usb/gadget/f_mass_storage.c |   14 +++-----------
>  1 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
> index 94b7bc3..ba24236 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -3033,21 +3033,13 @@ struct fsg_common *fsg_common_init(struct fsg_common *common,
>  
>  	fsg_common_set_inquiry_string(common, cfg->vendor_name,
>  				      cfg->product_name);
> -	/* Tell the thread to start working */
> -	common->thread_task =
> -		kthread_create(fsg_main_thread, common, "file-storage");
> -	if (IS_ERR(common->thread_task)) {
> -		rc = PTR_ERR(common->thread_task);
> -		goto error_release;
> -	}
>  
>  	/* Information */
>  	INFO(common, FSG_DRIVER_DESC ", version: " FSG_DRIVER_VERSION "\n");
> -	INFO(common, "Number of LUNs=%d\n", common->nluns);
>  
> -	DBG(common, "I/O thread pid: %d\n", task_pid_nr(common->thread_task));
> -
> -	wake_up_process(common->thread_task);
> +	rc = fsg_common_run_thread(common);
> +	if (rc)
> +		goto error_release;
>  
>  	return common;
>  
> -- 
> 1.7.0.4
>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux