From patchwork Wed May 20 14:30:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 24996 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4KEX5gE007985 for ; Wed, 20 May 2009 14:33:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbZETOdD (ORCPT ); Wed, 20 May 2009 10:33:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753083AbZETOdD (ORCPT ); Wed, 20 May 2009 10:33:03 -0400 Received: from rv-out-0506.google.com ([209.85.198.239]:62466 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbZETOdB (ORCPT ); Wed, 20 May 2009 10:33:01 -0400 Received: by rv-out-0506.google.com with SMTP id f9so156176rvb.1 for ; Wed, 20 May 2009 07:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=r6+ZwfoHUND7jr4N7rWJxK2j4hmsNOkBWIsaXDFIe2o=; b=Fj6JMFaCxhlA4xfNRS3PRweap9QRanAoEbmgR0CHx+ZklK+KVEhGwGjZ+QpPeaoBsF oX8TMiPuZQglECF38VsmyutwWCjUOIpucV4HI4yAHENCtKmnE2gKgzKkpxk5Lcwnr+WD KOWiTPDsIhVZaK0MUlmex30jGOE5jZ3/IDYoo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=ZGyE27MRN4KgAPglkBlwr56oBDkWnhWUapa2lindE/w0PG71VX7y9HeJ68VZFjm60Y HumLNB/1BF1bujXR715wnm/NGNDC6iPbvRhNmWYZgtpEW7QtDD9iFpPZmkcMkpXzMpB0 ZpbsFqRgKh/DfH56UiJDeXOeYrIa/7gLRSoN0= Received: by 10.140.199.16 with SMTP id w16mr581993rvf.2.1242829983396; Wed, 20 May 2009 07:33:03 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id g14sm3477524rvb.22.2009.05.20.07.33.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 May 2009 07:33:02 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 20 May 2009 23:30:06 +0900 Message-Id: <20090520143006.8314.55548.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: ap325 camera without i2c driver fix Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch fixes the ap325rxa ncm03j camera code to handle the case where no i2c driver is present. Without this fix i2c_transfer() may be passed NULL as adapter which results in a crash. Triggered when i2c-sh_mobile.c failed to probe() due to missing MSTP clocks. Signed-off-by: Magnus Damm --- arch/sh/boards/board-ap325rxa.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/sh/boards/board-ap325rxa.c +++ work/arch/sh/boards/board-ap325rxa.c 2009-05-20 22:25:41.000000000 +0900 @@ -263,6 +263,9 @@ static int camera_probe(void) struct i2c_msg msg; int ret; + if (!a) + return -ENODEV; + camera_power(1); msg.addr = 0x6e; msg.buf = camera_ncm03j_magic;