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: 460301 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p06JxsHU022648 for ; Thu, 6 Jan 2011 19:59:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236Ab1AFT7v (ORCPT ); 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 19:59:54 +0000 (UTC) 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: