From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BA00A4F for ; Mon, 21 Nov 2022 09:09:49 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="301055306" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="301055306" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 01:09:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="618757700" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="618757700" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP; 21 Nov 2022 01:09:46 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ox2oC-00FC2F-1b; Mon, 21 Nov 2022 11:09:44 +0200 Date: Mon, 21 Nov 2022 11:09:44 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Mauro Carvalho Chehab , Sakari Ailus , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 15/20] media: atomisp: Remove sw_contex.power_state checks Message-ID: References: <20221120224101.746199-1-hdegoede@redhat.com> <20221120224101.746199-16-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221120224101.746199-16-hdegoede@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Sun, Nov 20, 2022 at 11:40:56PM +0100, Hans de Goede wrote: > Remove the unnecessary sw_contex.power_state checks: > > 1. atomisp_freq_scaling() and atomisp_stop_streaming() only run when the > ISP is powered up through runtime-pm, so the checkes are not necessary > > 2. atomisp_mrfld_pre_power_down() and atomisp_runtime_resume() are only > called through the driver-core pm handling code which already > guarantees they are not called when already powered down / up. > > 3. atomisp_isr() also checks isp->css_initialized which only gets set > by atomisp_css_init() which runs *after* powering up the ISP and > which gets cleared by atomisp_css_uninit() *before* before powering > down the ISP. > > So all the checks are unnecessary, remove them as well as the > sw_contex.power_state field itself. ... > + /*Turn on ISP d-phy */ While at it, you may add a whitespace after /*. > + ret = atomisp_ospm_dphy_up(isp); > + if (ret) { > + dev_err(isp->dev, "Failed to power up ISP!.\n"); > + return -EINVAL; > } -- With Best Regards, Andy Shevchenko