From patchwork Thu Mar 20 19:29:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 26762 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 16E8220143 for ; Thu, 20 Mar 2014 19:36:32 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf3357911pab.5 for ; Thu, 20 Mar 2014 12:36:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=JdTvrRBDOMQUUKdhfx++atSRrEQCRL8YzuiC7XiiJpE=; b=SYRTyvRxvw/FzDxaC26YCQtGwkL3PhSNoa/k9mJLqThac1J/yIxqMC3h964q/aM9i7 bw4l+vcuiNuxO3JMGWDloJaEGLxQ/ZXPSbPEEP+I2lEH40nOXtS+xBKVP+QxgA9GlQQC EotuJPE+uJv5WMIKed4Pg6x4JCkQlBAAfGGXxYKnzDhIp2MW1oCEolInyZEoIgMe4yuM hvs5ShKqP99+lsJiQMa+lQZXfZi+3DQRoQDHD2uhEkNO+CvF+tuGZiXgoQwB7miN0wph L6BAYbc2zUkfwuMyPqRrVCc8urvbfHEPhZmGMebheiGap1DC/ocPmup1l9IB8cwu66gR jl0A== X-Gm-Message-State: ALoCoQkt1Fpq1znWTOQlNpH9/q1Uwlir3bbUD5jQRjLddIwVuRLHWxUA+ZYnYg32mLoO7/iWn82x X-Received: by 10.66.141.231 with SMTP id rr7mr7045461pab.47.1395344192325; Thu, 20 Mar 2014 12:36:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.81 with SMTP id r75ls397458qga.71.gmail; Thu, 20 Mar 2014 12:36:32 -0700 (PDT) X-Received: by 10.52.173.165 with SMTP id bl5mr20549626vdc.13.1395344192196; Thu, 20 Mar 2014 12:36:32 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id sj10si645135vcb.15.2014.03.20.12.36.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 12:36:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so1503560veb.32 for ; Thu, 20 Mar 2014 12:36:32 -0700 (PDT) X-Received: by 10.52.104.33 with SMTP id gb1mr1426801vdb.45.1395344192118; Thu, 20 Mar 2014 12:36:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp414147vck; Thu, 20 Mar 2014 12:36:31 -0700 (PDT) X-Received: by 10.66.246.229 with SMTP id xz5mr48812179pac.119.1395344190795; Thu, 20 Mar 2014 12:36:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yo5si2106760pab.333.2014.03.20.12.36.29; Thu, 20 Mar 2014 12:36:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965041AbaCTTcE (ORCPT + 26 others); Thu, 20 Mar 2014 15:32:04 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:53487 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754341AbaCTTb7 (ORCPT ); Thu, 20 Mar 2014 15:31:59 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2KJVuIK012721; Thu, 20 Mar 2014 14:31:56 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2KJVuMT018618; Thu, 20 Mar 2014 14:31:56 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 20 Mar 2014 14:31:56 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2KJVtEo029808; Thu, 20 Mar 2014 14:31:56 -0500 From: Felipe Balbi To: Greg KH CC: , , , , , Linux OMAP Mailing List , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 02/11] tty: serial: omap: switch over to devm_request_gpio Date: Thu, 20 Mar 2014 14:29:58 -0500 Message-ID: <1395343807-21618-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.9.1.286.g5172cb3 In-Reply-To: <1395343807-21618-1-git-send-email-balbi@ti.com> References: <1395343807-21618-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , this will make sure gpio gets freed automatically when this device is destroyed. Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 73abba8..db5d90b 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1594,7 +1594,7 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up, /* check for tx enable gpio */ up->rts_gpio = of_get_named_gpio_flags(np, "rts-gpio", 0, &flags); if (gpio_is_valid(up->rts_gpio)) { - ret = gpio_request(up->rts_gpio, "omap-serial"); + ret = devm_gpio_request(up->dev, up->rts_gpio, "omap-serial"); if (ret < 0) return ret; ret = gpio_direction_output(up->rts_gpio, @@ -1660,7 +1660,8 @@ static int serial_omap_probe(struct platform_device *pdev) if (gpio_is_valid(omap_up_info->DTR_gpio) && omap_up_info->DTR_present) { - ret = gpio_request(omap_up_info->DTR_gpio, "omap-serial"); + ret = devm_gpio_request(&pdev->dev, omap_up_info->DTR_gpio, + "omap-serial"); if (ret < 0) return ret; ret = gpio_direction_output(omap_up_info->DTR_gpio,