Patch Detail
Show a patch.
GET /api/patches/27/?format=api
{ "id": 27, "url": "https://patchwork.libcamera.org/api/patches/27/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20181211140028.25241-1-laurent.pinchart@ideasonboard.com>", "date": "2018-12-11T14:00:26", "name": "[libcamera-devel,1/3] utils: ipu3: Abort when sensor or media device isn't found", "commit_ref": "0d96f3e2322c5eecdd99bf134a2d80429836b778", "pull_url": null, "state": "accepted", "archived": false, "hash": "428870ba32eae37e91961e684b93e196f7e3237d", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27/mbox/", "series": [ { "id": 15, "url": "https://patchwork.libcamera.org/api/series/15/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=15", "date": "2018-12-11T14:00:26", "name": "[libcamera-devel,1/3] utils: ipu3: Abort when sensor or media device isn't found", "version": 1, "mbox": "https://patchwork.libcamera.org/series/15/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63E9160B0C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 11 Dec 2018 14:59:49 +0100 (CET)", "from avalon.bb.dnainternet.fi\n\t(dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8E1F455A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 11 Dec 2018 14:59:48 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1544536788;\n\tbh=zir8mpyr7m2qO/0Wahve29zbxJ27Sekcs6lxWSsshp8=;\n\th=From:To:Subject:Date:From;\n\tb=Owe98mTMcIVkwpA+GLC30uZ59q/oUrzHXsGETGbH94O0osu05RPANNwyQJb+S97VM\n\trz/NgWFTj08WiAyizASfEbhoPTNDsnucqm+l8ZbB/lFfT9xpZEU2RoJKgjUvpBtjLW\n\tGVkdu2BIZc272PxE/3eaB7cd8VAu947DIGSSyguo=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 11 Dec 2018 16:00:26 +0200", "Message-Id": "<20181211140028.25241-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.19.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 1/3] utils: ipu3: Abort when sensor or\n\tmedia device isn't found", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Tue, 11 Dec 2018 13:59:49 -0000" }, "content": "Calling exit from a function only exits from the function, it doesn't\nabort the whole script. Propagate the errors to stop operation when the\nsensor or media device can't be found.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/ipu3/ipu3-capture.sh | 16 ++++++----------\n utils/ipu3/ipu3-process.sh | 6 +++---\n 2 files changed, 9 insertions(+), 13 deletions(-)", "diff": "diff --git a/utils/ipu3/ipu3-capture.sh b/utils/ipu3/ipu3-capture.sh\nindex af189da3f8d8..ba6147b49799 100755\n--- a/utils/ipu3/ipu3-capture.sh\n+++ b/utils/ipu3/ipu3-capture.sh\n@@ -20,7 +20,8 @@ find_sensor() {\n \n \tbus=$(grep \"$sensor_name\" /sys/class/video4linux/v4l-subdev*/name | cut -d ' ' -f 2)\n \tif [[ -z $bus ]]; then\n-\t\treturn\n+\t\techo \"Sensor '$sensor_name' not found.\" >&2\n+\t\texit 1\n \tfi\n \n \techo \"$sensor_name $bus\"\n@@ -36,8 +37,8 @@ find_media_device() {\n \tdone\n \n \tif [[ -z $mdev ]] ; then\n-\t echo \"IPU3 media device not found.\" >&2\n-\t exit 1\n+\t\techo \"IPU3 media device not found.\" >&2\n+\t\texit 1\n \tfi\n \n \techo $mdev\n@@ -170,13 +171,8 @@ fi\n \n sensor_name=$1\n \n-sensor=$(find_sensor $sensor_name)\n-if [[ -z $sensor ]] ; then\n-\techo \"Sensor '$sensor_name' not found.\" >&2\n-\texit 1\n-fi\n-\n-mdev=$(find_media_device)\n+sensor=$(find_sensor $sensor_name) || exit\n+mdev=$(find_media_device) || exit\n mediactl=\"media-ctl -d $mdev\"\n \n parse_pipeline $sensor\ndiff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh\nindex 6412aea4a3e7..78a7937fca70 100755\n--- a/utils/ipu3/ipu3-process.sh\n+++ b/utils/ipu3/ipu3-process.sh\n@@ -23,8 +23,8 @@ find_media_device() {\n \tdone\n \n \tif [[ -z $mdev ]] ; then\n-\t echo \"IPU3 media device not found.\" >&2\n-\t exit 1\n+\t\techo \"IPU3 media device not found.\" >&2\n+\t\texit 1\n \tfi\n \n \techo $mdev\n@@ -173,7 +173,7 @@ fi\n out_size=${out_size:-$in_size}\n vf_size=${vf_size:-$in_size}\n \n-mdev=$(find_media_device)\n+mdev=$(find_media_device) || exit\n mediactl=\"media-ctl -d $mdev\"\n echo \"Using device $mdev\"\n \n", "prefixes": [ "libcamera-devel", "1/3" ] }