From patchwork Tue May 2 12:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 679018 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F13C3C77B7E for ; Tue, 2 May 2023 12:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233920AbjEBMyN (ORCPT ); Tue, 2 May 2023 08:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233513AbjEBMyL (ORCPT ); Tue, 2 May 2023 08:54:11 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E83CE for ; Tue, 2 May 2023 05:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683032050; x=1714568050; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2X6TGfjfdebEXPi36TQE8UWih7e+tQJ9YVWejKLc/ck=; b=RfbPO6nfkwV3b6+SxLC6PJwSmpwx+6egbgSKk5G8sK/TT/yC4cGA0xf9 QZfnaCsMkzYz6NFwI+SPSBbmimOmT6kbaZF4+gipM3/Jz7Ie1+xXOx58D ZIIM6Bi1YgQPTGBurT7R8nU6YapAIdcusomm0fHB5lZQ4Pg71FBlQT3ty +/EJmmDQkS5VJSz5r1Uykpo1E+KH7xZC54jLmh+KDN55De+OegFxTHXMm MtEsKk41Xf30xgyIlQbGFVoP7HdVSSFLjC6VzbSW3q/90PktBG7ejj1oY rztlv+rEN0559LtpGjcHcjDKK9kChfg0ui+AFZgAywHMlGIJR11kpUDWn Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="434706050" X-IronPort-AV: E=Sophos;i="5.99,244,1677571200"; d="scan'208";a="434706050" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 05:54:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="690269580" X-IronPort-AV: E=Sophos;i="5.99,244,1677571200"; d="scan'208";a="690269580" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 05:54:09 -0700 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id DB8F61203DA; Tue, 2 May 2023 15:54:06 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.94.2) (envelope-from ) id 1ptpU8-0031KW-MR; Tue, 02 May 2023 15:52:00 +0300 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: jacopo.mondi@ideasonboard.com Subject: [PATCH 1/1] media: i2c: ov5670: Fix conditions for clock access Date: Tue, 2 May 2023 15:51:50 +0300 Message-Id: <20230502125150.720051-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Leftovers from the earlier fix. Fix also the conditions for reading the clock-frequency property as well as accessing the clock. Fixes: 8df08ba4a331 ("media: ov5670: Fix probe on ACPI") Signed-off-by: Sakari Ailus --- drivers/media/i2c/ov5670.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index c5e783a06f06c..5437cf32a7b3a 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2661,9 +2661,9 @@ static int ov5670_probe(struct i2c_client *client) } ov5670->xvclk = devm_clk_get_optional(&client->dev, NULL); - if (!IS_ERR_OR_NULL(ov5670->xvclk)) + if (!IS_ERR(ov5670->xvclk)) input_clk = clk_get_rate(ov5670->xvclk); - else if (PTR_ERR(ov5670->xvclk) == -ENOENT) + else if (!ov5670->xvclk) device_property_read_u32(&client->dev, "clock-frequency", &input_clk); else