Re: [PATCH v6 1/3] fpga: mgr: Use standard dev_release for class driver

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

 




On 6/22/21 1:45 AM, Xu Yilun wrote:
> Some more comments.
>
> On Mon, Jun 21, 2021 at 03:22:47PM -0700, Russ Weight wrote:
>> +struct fpga_manager *
>> +fpga_mgr_register(struct device *parent, struct fpga_manager_info *info)
>>  {
>> +	const struct fpga_manager_ops *mops = info->mops;
>>  	struct fpga_manager *mgr;
>>  	int id, ret;
>>  
>> @@ -572,29 +570,31 @@ struct fpga_manager *fpga_mgr_create(struct device *parent, const char *name,
> Shall we add the check?

It's already there in the line before the context that is shown.

>
> 	if (!mops || ...)
>
>>  	    !mops->write_init || (!mops->write && !mops->write_sg) ||
>>  	    (mops->write && mops->write_sg)) {
>>  		dev_err(parent, "Attempt to register without fpga_manager_ops\n");
>> -		return NULL;
>> +		return ERR_PTR(-EINVAL);
>>  	}
>>  
>>
> [...]
>   
>> +struct fpga_manager *
>> +fpga_mgr_register(struct device *dev, struct fpga_manager_info *info);
> 		     struct device *parent, const struct fpga_manager_info
Yes - I'll fix all of the prototypes.

Thanks,
- Russ

>
>>  
>> -int devm_fpga_mgr_register(struct device *dev, struct fpga_manager *mgr);
>> +struct fpga_manager *
>> +fpga_mgr_register_simple(struct device *dev, const char *name,
> 			    struct device *parent,
>
>> +			 const struct fpga_manager_ops *mops, void *priv);
>> +void fpga_mgr_unregister(struct fpga_manager *mgr);
>>  
>> -struct fpga_manager *devm_fpga_mgr_create(struct device *dev, const char *name,
>> -					  const struct fpga_manager_ops *mops,
>> -					  void *priv);
>> +struct fpga_manager *
>> +devm_fpga_mgr_register(struct device *dev, struct fpga_manager_info *info);
>
> 			  struct device *parent, const struct fpga_manager_info
>
>> +struct fpga_manager *
>> +devm_fpga_mgr_register_simple(struct device *dev, const char *name,
> 				 struct device *parent,
>
>> +			      const struct fpga_manager_ops *mops, void *priv);
>>  
>>  #endif /*_LINUX_FPGA_MGR_H */
>> -- 
>> 2.25.1




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux