From patchwork Thu Jan 6 19:59:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 5455 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Thu, 06 Jan 2011 18:05:27 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1Paw5O-0004iE-ND for mchehab@gaivota; Thu, 06 Jan 2011 18:05:27 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 06 Jan 2011 18:05:26 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Paw0f-0002xG-O2; Thu, 06 Jan 2011 20:00:34 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236Ab1AFT7v (ORCPT + 1 other); Thu, 6 Jan 2011 14:59:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48313 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753232Ab1AFT7u (ORCPT ); Thu, 6 Jan 2011 14:59:50 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06JxnUK007620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Jan 2011 14:59:49 -0500 Received: from xeratul.lab.bos.redhat.com (amd-tyan2915-01.lab.eng.bos.redhat.com [10.16.42.12]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p06JxnQN013208; Thu, 6 Jan 2011 14:59:49 -0500 From: Jarod Wilson To: linux-media@vger.kernel.org Cc: Kyle McMartin , Maxim Levitsky , Jarod Wilson Subject: [PATCH 2/6] rc/ene_ir: fix oops on module load Date: Thu, 6 Jan 2011 14:59:33 -0500 Message-Id: <1294343977-31929-3-git-send-email-jarod@redhat.com> In-Reply-To: <1294343839-31784-1-git-send-email-jarod@redhat.com> References: <1294343839-31784-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab From: Kyle McMartin dev->rdev is accessed in ene_setup_hw_settings, so it needs to be wired up before then. [Jarod Wilson]: Also fix a possible improper resource freeing bug while we're looking at possible probe issues here. Signed-off-by: Kyle McMartin CC: Maxim Levitsky Signed-off-by: Jarod Wilson --- drivers/media/rc/ene_ir.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 80b3c31..885abdd 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c @@ -1004,6 +1004,10 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) /* validate resources */ error = -ENODEV; + /* init these to -1, as 0 is valid for both */ + dev->hw_io = -1; + dev->irq = -1; + if (!pnp_port_valid(pnp_dev, 0) || pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) goto error; @@ -1072,6 +1076,8 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) rdev->input_name = "ENE eHome Infrared Remote Transceiver"; } + dev->rdev = rdev; + ene_rx_setup_hw_buffer(dev); ene_setup_default_settings(dev); ene_setup_hw_settings(dev); @@ -1083,7 +1089,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) if (error < 0) goto error; - dev->rdev = rdev; ene_notice("driver has been succesfully loaded"); return 0; error: