Re: [RFCv4 PATCH 08/13] usb: gadget: example port of mass storage to UFG: f_mass_storage: remove unused operations

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

 



On Thu, Nov 22 2012, Andrzej Pietrasiewicz wrote:
> pre_eject and post_eject are not used by anyone. Removing them.
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

As far as I'm concerned, this can get merged regardless of the other
patches.

> ---
>  drivers/usb/gadget/f_mass_storage.c |   15 +--------------
>  drivers/usb/gadget/f_mass_storage.h |   14 --------------
>  2 files changed, 1 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
> index 62687df..a6b3a94 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -1259,26 +1259,13 @@ static int do_start_stop(struct fsg_common *common)
>  	if (!loej)
>  		return 0;
>  
> -	/* Simulate an unload/eject */
> -	if (common->ops && common->ops->pre_eject) {
> -		int r = common->ops->pre_eject(common, curlun,
> -					       curlun - common->luns);
> -		if (unlikely(r < 0))
> -			return r;
> -		else if (r)
> -			return 0;
> -	}
> -
>  	up_read(&common->filesem);
>  	down_write(&common->filesem);
>  	fsg_lun_close(curlun);
>  	up_write(&common->filesem);
>  	down_read(&common->filesem);
>  
> -	return common->ops && common->ops->post_eject
> -		? min(0, common->ops->post_eject(common, curlun,
> -						 curlun - common->luns))
> -		: 0;
> +	return 0;
>  }
>  
>  static int do_prevent_allow(struct fsg_common *common)
> diff --git a/drivers/usb/gadget/f_mass_storage.h b/drivers/usb/gadget/f_mass_storage.h
> index 9f8d47e..df313e3 100644
> --- a/drivers/usb/gadget/f_mass_storage.h
> +++ b/drivers/usb/gadget/f_mass_storage.h
> @@ -19,20 +19,6 @@ struct fsg_operations {
>  	 * set).
>  	 */
>  	int (*thread_exits)(struct fsg_common *common);
> -
> -	/*
> -	 * Called prior to ejection.  Negative return means error,
> -	 * zero means to continue with ejection, positive means not to
> -	 * eject.
> -	 */
> -	int (*pre_eject)(struct fsg_common *common,
> -			 struct fsg_lun *lun, int num);
> -	/*
> -	 * Called after ejection.  Negative return means error, zero
> -	 * or positive is just a success.
> -	 */
> -	int (*post_eject)(struct fsg_common *common,
> -			  struct fsg_lun *lun, int num);
>  };
>  
>  /* Data shared by all the FSG instances. */

-- 
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: pgpNakQNAOguM.pgp
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