From: Federico Vaga <federico.vaga@gmail.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: mchehab@redhat.com, hans.verkuil@cisco.com,
giancarlo.asnaghi@st.com, prabhakar.csengg@gmail.com,
yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org
Subject: Re: [PATCH v2] [media] sta2x11_vip: fix error return code in sta2x11_vip_init_one()
Date: Mon, 13 May 2013 16:02:21 +0200 [thread overview]
Message-ID: <1587030.87unLCKBly@harkonnen> (raw)
In-Reply-To: <CAPgLHd8gFagqNM8y3WAfw1F8sddPWzB9TN1U8EOF8VrknOoeOg@mail.gmail.com>
On Monday 13 May 2013 22:00:01 Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> The orig code will release all the resources if v4l2_device_register()
> failed and return 0. But what we need in this case is to return an
> negative error code to let the caller known we are failed.
> So the patch save the return value of v4l2_device_register() to 'ret'
> and return it when error.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
> ---
> v1 -> v2: change the commit message
> ---
> drivers/media/pci/sta2x11/sta2x11_vip.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c
> b/drivers/media/pci/sta2x11/sta2x11_vip.c index 7005695..77edc11 100644
> --- a/drivers/media/pci/sta2x11/sta2x11_vip.c
> +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
> @@ -1047,7 +1047,8 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
> ret = sta2x11_vip_init_controls(vip);
> if (ret)
> goto free_mem;
> - if (v4l2_device_register(&pdev->dev, &vip->v4l2_dev))
> + ret = v4l2_device_register(&pdev->dev, &vip->v4l2_dev);
> + if (ret)
> goto free_mem;
>
> dev_dbg(&pdev->dev, "BAR #0 at 0x%lx 0x%lx irq %d\n",
--
Federico Vaga
prev parent reply other threads:[~2013-05-13 14:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 14:00 [PATCH v2] [media] sta2x11_vip: fix error return code in sta2x11_vip_init_one() Wei Yongjun
2013-05-13 14:02 ` Federico Vaga [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1587030.87unLCKBly@harkonnen \
--to=federico.vaga@gmail.com \
--cc=giancarlo.asnaghi@st.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=prabhakar.csengg@gmail.com \
--cc=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.