···246246struct media_request *247247media_request_get_by_fd(struct media_device *mdev, int request_fd)248248{249249- struct file *filp;249249+ struct fd f;250250 struct media_request *req;251251252252 if (!mdev || !mdev->ops ||253253 !mdev->ops->req_validate || !mdev->ops->req_queue)254254 return ERR_PTR(-EACCES);255255256256- filp = fget(request_fd);257257- if (!filp)256256+ f = fdget(request_fd);257257+ if (!f.file)258258 goto err_no_req_fd;259259260260- if (filp->f_op != &request_fops)260260+ if (f.file->f_op != &request_fops)261261 goto err_fput;262262- req = filp->private_data;262262+ req = f.file->private_data;263263 if (req->mdev != mdev)264264 goto err_fput;265265266266 /*267267 * Note: as long as someone has an open filehandle of the request,268268- * the request can never be released. The fget() above ensures that268268+ * the request can never be released. The fdget() above ensures that269269 * even if userspace closes the request filehandle, the release()270270 * fop won't be called, so the media_request_get() always succeeds271271 * and there is no race condition where the request was released272272 * before media_request_get() is called.273273 */274274 media_request_get(req);275275- fput(filp);275275+ fdput(f);276276277277 return req;278278279279err_fput:280280- fput(filp);280280+ fdput(f);281281282282err_no_req_fd:283283 dev_dbg(mdev->dev, "cannot find request_fd %d\n", request_fd);