From patchwork Tue May 20 10:17:07 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: 4208711 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D8AB49F23C for ; Tue, 20 May 2014 10:17:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F36AD201BF for ; Tue, 20 May 2014 10:17:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19BF420131 for ; Tue, 20 May 2014 10:17:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbaETKRU (ORCPT ); Tue, 20 May 2014 06:17:20 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:48488 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbaETKRU (ORCPT ); Tue, 20 May 2014 06:17:20 -0400 Received: by mail-pd0-f169.google.com with SMTP id w10so192199pde.28 for ; Tue, 20 May 2014 03:17:19 -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=ifC2ZggMLwYe0Ql3wj3i1C2lhrN9hdShHu8z2c5BaSw=; b=zo7oB3IIuNsDDMm0UWFkw2mq6dc0MyMef3VwzjCS0KFbxyPbj34fTRHqvaj8ewUNbD 3OxeFJsBX/2j0ki1Q5aMh4bFFhGWaSUEaYR6Faok0Xenh2XltA8YxxBJ5fPfuyLsy/Nk vP5mG2f9Suty2ToUEzjPZx3LBaZlZNOo9dNHbj+zapNDDrboARJhJ9wDfpaAMnADXjd+ u3P6WFe0RagDYYiyZ2CI7uPfXOGRN4HrpYfSJDJsrUkFICNogIBnXh+3lWWsH4NBykj0 qw1aripjTo/5zAGukGxN872ZN1mJTgAz8ZcD5RM8OLH4DZBH8E+/el7aOgzBLgJBMA5E SYAA== X-Received: by 10.68.135.42 with SMTP id pp10mr49065527pbb.58.1400581039197; Tue, 20 May 2014 03:17:19 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id ry10sm88016931pab.38.2014.05.20.03.17.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 03:17:18 -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, arunkk.samsung@gmail.com Subject: [PATCH 1/3] [media] s5p-mfc: Remove duplicate function s5p_mfc_reload_firmware Date: Tue, 20 May 2014 15:47:07 +0530 Message-Id: <1400581029-3475-2-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400581029-3475-1-git-send-email-arun.kk@samsung.com> References: <1400581029-3475-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=ham 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 --- 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) {