Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7528409ybi; Wed, 5 Jun 2019 19:58:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzc4R5bW3XTA2M8wZz4iJzdGvj0fE26AIfgQ/3X1rNxewcPRXd4nJ0vxwg6NbcPOaLSk97Z X-Received: by 2002:a17:902:bc8a:: with SMTP id bb10mr48664664plb.310.1559789898962; Wed, 05 Jun 2019 19:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559789898; cv=none; d=google.com; s=arc-20160816; b=P0J93phRBJstjRqwIi9xQn1cj0OIjyYumlg4qOf6CSSQ0QIu2noFwXC5MXSWIWMeam QYadi4/GdnfAFg2vTdnJNYpYFD35RvwtzBjEemNggnywP+OBReb/wK7+pKc99o1QtIt5 KSPyk0GaefmAL8FBzzLW0+wBtFOnU+W56gttQWbce6gv1ysjCZTRxVeu1UcvpZsMfeDn Tf6HVI37bhEUNgrmNIoyCGUcOxiJWN7mMBrQKzul8C7vfdpT4fNyWMXA4D/wWMQlXH1S J2rn5c5fYz0sAtvN3ljfd7h8wKvlvzhdjIX5WWmsVEN5Sp8rBTT0LhBFOj32If3XmOuo JWSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ysY+52fXMYI7MZwAXhhPIwcn7G+33VLkTlff+m5jejA=; b=igx0XwOzCLVrGiGKkeKQlkFvzvm8HOb2szScF7+ImvmrbVaYRF5xvssxRxvweL5/+L IdeDSQ3B2ak/IhQ18NDiQyIaLgIGtxe1/a8emIFNhcyLYwICxBdnJAX4/CHvOThLom9o +fRim9GZQsVbWKNkMN+lLRTlxYki+raFHAmy/Tn6yjTSjQBCRvdhD/ickneHHE8y7ITY CIr5aRvYGz6dMnWkxdA2nVIKdu6eaMQAZV9vIbQApdQV6IafHM9bCAYcLxJuGnX9VpuZ DzX0VoFbgCM0wE37RHoj2lJb5kP2Zq82XJc2B1vKYYLWyNO2Vam7URrxUYbqMQfsqNM/ DTrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KsA3nuu4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s59si419672plb.294.2019.06.05.19.58.02; Wed, 05 Jun 2019 19:58:18 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KsA3nuu4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726921AbfFFCzD (ORCPT + 99 others); Wed, 5 Jun 2019 22:55:03 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46789 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfFFCyu (ORCPT ); Wed, 5 Jun 2019 22:54:50 -0400 Received: by mail-pf1-f195.google.com with SMTP id y11so517854pfm.13; Wed, 05 Jun 2019 19:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ysY+52fXMYI7MZwAXhhPIwcn7G+33VLkTlff+m5jejA=; b=KsA3nuu4Ro2foXc43IhBKNFQ7rh67P0KGHzmxz7m9f/oV3mj7ycORtzRX3NxCkXvMa cnH+kU33bbdJFQH1sRpyEbZFsN0xgho3dosKvHh9GqSu6XIxONAE7jCDR23WL7AFI+Mn XnxgM38THM+qU08dKGHSUHiEen1LWyv5I4Yb3GXNCo5KWYtBdhPJg0VeIKQMM/JNrK0J Tb6+rGF3jOhz/QZW348OfG9Rnld9PwO3DLPXFahWKNHLI5Ep+vlvCTnhd36pn46uTDEH twZWqIupF7avQ+L4KQvOP4g53S8WEdJgvEn0VtCKfnmMfPNw+6uQhsI3W+tbBOWOmqFv FQXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ysY+52fXMYI7MZwAXhhPIwcn7G+33VLkTlff+m5jejA=; b=Cx5pc33xI6zdX67rdaLVsy0VaR0P4GuUMVpuKR4SdKux3TRAXbH+NVnrvMt2wTMQmd UWTxzeKi2joAw/NvKvbqsaANmV5pZWrPkXKfoITAtJWHHv3F8Wv7nZ2nA5yHc8haJyLP SUYA/E26AwJTnIbzoFtCmwd7kCNhQvHxrKg3fFb9QpB1jpBkowDz0N+g2YsJ7ueeaZXN afwzvFMjhkn9d4xlf55yBr6GUFGV3v3Oo5kOmFK9T1STB4rSTW7IzkWmQ1dN9rSkYciT Widz5qaH5n/3ZXopGQr5kDZRkmHfSeiIEh2km4eRPFNwKv7r7VFHCmSCwSaIxFpAm2FC kerQ== X-Gm-Message-State: APjAAAWBty0d6EtN6kQyl59mq/FnlB9qzsSYvU9yFB5sEo7H4KOqGP/U y/MzJULayu+ISb/cfP8he7E= X-Received: by 2002:a17:90a:a616:: with SMTP id c22mr48684484pjq.46.1559789689688; Wed, 05 Jun 2019 19:54:49 -0700 (PDT) Received: from localhost (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id 10sm290548pfh.179.2019.06.05.19.54.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 19:54:48 -0700 (PDT) From: "Ji-Ze Hong (Peter Hong)" X-Google-Original-From: "Ji-Ze Hong (Peter Hong)" To: johan@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter_hong@fintek.com.tw, "Ji-Ze Hong (Peter Hong)" Subject: [PATCH V1 5/6] USB: serial: f81232: Use devm_kzalloc Date: Thu, 6 Jun 2019 10:54:15 +0800 Message-Id: <1559789656-15847-6-git-send-email-hpeter+linux_kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559789656-15847-1-git-send-email-hpeter+linux_kernel@gmail.com> References: <1559789656-15847-1-git-send-email-hpeter+linux_kernel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_kzalloc() to replace kzalloc(). Signed-off-by: Ji-Ze Hong (Peter Hong) --- drivers/usb/serial/f81232.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 7d1ec8f9d168..708d85c7d822 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81232.c @@ -1198,7 +1198,7 @@ static int f81232_port_probe(struct usb_serial_port *port) struct f81232_private *priv; int status = 0; - priv = kzalloc(sizeof(*priv), GFP_KERNEL); + priv = devm_kzalloc(&port->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -1234,16 +1234,6 @@ static int f81232_port_probe(struct usb_serial_port *port) return status; } -static int f81232_port_remove(struct usb_serial_port *port) -{ - struct f81232_private *priv; - - priv = usb_get_serial_port_data(port); - kfree(priv); - - return 0; -} - static int f81232_suspend(struct usb_serial *serial, pm_message_t message) { struct usb_serial_port *port = serial->port[0]; @@ -1301,7 +1291,6 @@ static struct usb_serial_driver f81232_device = { .process_read_urb = f81232_read_urb_proxy, .read_int_callback = f81232_read_int_callback, .port_probe = f81232_port_probe, - .port_remove = f81232_port_remove, .suspend = f81232_suspend, .resume = f81232_resume, }; -- 2.7.4