From patchwork Wed May 21 09:29:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 4215421 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C231BBEEAC for ; Wed, 21 May 2014 09:29:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7914201FE for ; Wed, 21 May 2014 09:29:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAA80202DD for ; Wed, 21 May 2014 09:29:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbaEUJ3r (ORCPT ); Wed, 21 May 2014 05:29:47 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:57340 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbaEUJ3p (ORCPT ); Wed, 21 May 2014 05:29:45 -0400 Received: by mail-pd0-f172.google.com with SMTP id x10so1222295pdj.17 for ; Wed, 21 May 2014 02:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=caBeiaHWCIu94vNSZvggm81J7lFoZxMBTKngDSJwmPY=; b=edcdmlD+YWrv5Cg33vEkDGP7Kmz7TRES0q+nhCBpAL04CwVxXAv6oS2sb/yNF5j0Q2 83nifd+pB8dJbpUfVXMlBT4mdkwZc4PLMOa0+XRmGuUmdaLrDXta7+S/YttmbqEzjtxm OyLQVvwff7OtFQJtme2dbQ/8yfu7KXuP1TW+pww2moPfFJoP1jZKXvu2qE5uIlGpQqSQ pGEpgk5e72jbwxgCcihSxJGD+HrUjiJ0rv+aGJFSbGadawFdssknCzbt6/zgga7Q3rOr 9g3yAlpmDcK7J84SrDifFGtTnplYXI9MGapwsfXEZgCQkl71fRnqoWBw9tNEskaitqy5 RNXA== X-Received: by 10.68.227.4 with SMTP id rw4mr57553607pbc.3.1400664584799; Wed, 21 May 2014 02:29:44 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id fu12sm102504908pad.42.2014.05.21.02.29.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 02:29:44 -0700 (PDT) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: k.debski@samsung.com, s.nawrocki@samsung.com, posciak@chromium.org, avnd.kiran@samsung.com, sachin.kamat@linaro.org, t.figa@samsung.com, arunkk.samsung@gmail.com Subject: [PATCH v2 1/3] [media] s5p-mfc: Remove duplicate function s5p_mfc_reload_firmware Date: Wed, 21 May 2014 14:59:29 +0530 Message-Id: <1400664571-13746-2-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400664571-13746-1-git-send-email-arun.kk@samsung.com> References: <1400664571-13746-1-git-send-email-arun.kk@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function s5p_mfc_reload_firmware is exactly same as s5p_mfc_load_firmware. So removing the duplicate function. Signed-off-by: Arun Kumar K Reviewed-by: Tomasz Figa --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 33 ------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 9ed0985..8da4c23 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -162,7 +162,7 @@ static void s5p_mfc_watchdog_worker(struct work_struct *work) /* Double check if there is at least one instance running. * If no instance is in memory than no firmware should be present */ if (dev->num_inst > 0) { - ret = s5p_mfc_reload_firmware(dev); + ret = s5p_mfc_load_firmware(dev); if (ret) { mfc_err("Failed to reload FW\n"); goto unlock; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index 6c3f8f7..c97c7c8 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -107,39 +107,6 @@ int s5p_mfc_load_firmware(struct s5p_mfc_dev *dev) return 0; } -/* Reload firmware to MFC */ -int s5p_mfc_reload_firmware(struct s5p_mfc_dev *dev) -{ - struct firmware *fw_blob; - int err; - - /* Firmare has to be present as a separate file or compiled - * into kernel. */ - mfc_debug_enter(); - - err = request_firmware((const struct firmware **)&fw_blob, - dev->variant->fw_name, dev->v4l2_dev.dev); - if (err != 0) { - mfc_err("Firmware is not present in the /lib/firmware directory nor compiled in kernel\n"); - return -EINVAL; - } - if (fw_blob->size > dev->fw_size) { - mfc_err("MFC firmware is too big to be loaded\n"); - release_firmware(fw_blob); - return -ENOMEM; - } - if (!dev->fw_virt_addr) { - mfc_err("MFC firmware is not allocated\n"); - release_firmware(fw_blob); - return -EINVAL; - } - memcpy(dev->fw_virt_addr, fw_blob->data, fw_blob->size); - wmb(); - release_firmware(fw_blob); - mfc_debug_leave(); - return 0; -} - /* Release firmware memory */ int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev) {