From patchwork Mon Aug 13 12:59:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 1312711 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5C157DF223 for ; Mon, 13 Aug 2012 13:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678Ab2HMNAR (ORCPT ); Mon, 13 Aug 2012 09:00:17 -0400 Received: from pequod.mess.org ([93.97.41.153]:47016 "EHLO pequod.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519Ab2HMM7z (ORCPT ); Mon, 13 Aug 2012 08:59:55 -0400 Received: by pequod.mess.org (Postfix, from userid 1000) id 7833F15FDB; Mon, 13 Aug 2012 13:59:53 +0100 (BST) From: Sean Young To: Mauro Carvalho Chehab , Jarod Wilson , Stefan Macher , linux-media@vger.kernel.org Subject: [PATCH 11/13] [media] rc: transmit on device which does not support it should fail Date: Mon, 13 Aug 2012 13:59:49 +0100 Message-Id: <1344862791-30352-11-git-send-email-sean@mess.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1344862791-30352-1-git-send-email-sean@mess.org> References: <1344862791-30352-1-git-send-email-sean@mess.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Currently write() will return 0 if an IR device does not support sending. Signed-off-by: Sean Young --- drivers/media/rc/ir-lirc-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index 5faba2a..d2fd064 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c @@ -105,7 +105,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf, struct lirc_codec *lirc; struct rc_dev *dev; unsigned int *txbuf; /* buffer with values to transmit */ - ssize_t ret = 0; + ssize_t ret = -EINVAL; size_t count; lirc = lirc_get_pdata(file);