Message ID | 20230704094745.25665-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1111945vqx; Tue, 4 Jul 2023 03:23:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7l8SAgJUCYgnMdmjxRLzEQ4oMz+1AO2Nf1dDeBaisItrfRBDcGwXv0qnnaInWIeDdEZUUY X-Received: by 2002:aca:190a:0:b0:3a1:eb0e:ddc6 with SMTP id l10-20020aca190a000000b003a1eb0eddc6mr12432317oii.29.1688466218383; Tue, 04 Jul 2023 03:23:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688466218; cv=pass; d=google.com; s=arc-20160816; b=mKGNn6nnDMyj2QaLfm9uy7POtoQ7fOXy/IBO5XbgY4BWy0zTOMvj43bmBW0U/EDKJ9 BSyg9cFlrD7qXL/m/rB3VM0va5pLLOoeRhqMvQzj03EZLfZsGckSo6lZ/0+NFynz6DzB MG93lHg38PjydYzuYf8QXSwHCjTYCpjOLsoNMjWTiv8XhyYCsAACUloqm+PIFwMpq19F lJ+I4Mp8d9S6X0OW6OBMu3agqjoKSYibbQxDqUijA+AmMwLtMDgCrI7lRyJWeNuZbn6C g97JHB+DQOSXYdJYiWc9sVaobOv1Bmlv+9UoJCILiKfq0pRFi7G9EOW+lR+VFzUz2/bo LLrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; fh=Qcyam3eU2gGYjWgLmWnXwIH5Hk7gZDbNVaVgm4L3EtY=; b=LF6J52llg6C7tcFq8+TGsnc/28nRnqHxa5m0WUl3kpP6DDB4MrKyXJE7KGRULIUBsT DIcEvoeCvsRAdr1OEZe71FlAXCiVneZdqHRDOIh0b5976kDt8+PvvUn0y3f+cDumBZK/ i+TGbL8X3a63LfRkMXqmzIueptp3uVQwmRhe89riSuvDwdFDZkxEdkK0joSLM/hGuR4E 4xtBQZAjuhUyGYqobbZkJw5iPg5kvmXLped2ecBiW1pvtZxTnE3oLvUAFDwWnIkWnDQc SLG6m6SD0zX13Fu574da6iceusa9kHN7OBnMhprf/YwxzD7UF3zeUC2ikXQ1gZjZigdL 74/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=REaVaGME; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p41-20020a056a000a2900b00661cd40bd67si19172925pfh.314.2023.07.04.03.23.23; Tue, 04 Jul 2023 03:23:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=REaVaGME; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbjGDJsE (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Tue, 4 Jul 2023 05:48:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjGDJsC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Jul 2023 05:48:02 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09898B5; Tue, 4 Jul 2023 02:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSXDz5n1T5E5DfbR1nmsFQFfkp1K/rs1+Jpjfck0X4ZmMdpTq+KIOH9osEd9objFDsed74IbDcCSV2aar8rv+4fkScUlbyOEPpookZsL3sFwVAkUUgFwa0a1/JzUaxmaoUhxWf0UPhzk9lqzmn9L/0QyFSYUuCh2n7jAFNUsGd4bl2wPFazwk/QyOHgRHB/J2r3Ll+uFjN35gp4Usj5BAXx+EtntAwu2QQxmb4qpai5vdQ4r2ScyqfAq2JK2tT8Eb6/UbKdusQuhQ96CIZMWX+7A9B2kdA9KlNsHsAIsCP57dHYYhNdppb3nB1twVan0OhWTt0ym5tkESxuWrIFAfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; b=dOyd29o7/7HesSyo8ZnwleujANleMv82dcznKHtuUqWPqrIu/8DwpQBEoEGwj+drjbUf+ShRWAtFIzDh9b7IekAmW+NRDLs10f+mfjIKFVMZDisE3aVOUb5mj2ze+gu1bJ5Hs0mqeoe/NKlBYE+UryB4NvpjZvsm1HWL6KXcYYYis0X/84B0nWHJl5mpPQUsZRF4vR6xTZq2B/BeJQJXzd86kHNhawr/CbfRsVB9+P9g6x9bnkEJBncPqJslIYfBkzmR7QpTXpHz380KkgCWhg8tHavL9hEY+5brxFwwiO38amI1wEbLsEgVV7XM69q8V2UMAHGUx6PIxOU0opT7sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=183HJOQvmDlQVgEgcD5hQMtawkkw4U6Xl61Zww+fE6A=; b=REaVaGMEYY2NiMB8J9PCRcsCybjVPduWL49ick6nktykJNBgs/ZRtZruJ5kmR2YXLFy3TG40pAI5erweYnfpMV8mysmrToO17ZB0X/O9yuicmlQymgcuv1X5LEh4VnWHjxeEFAVOp+QP0cHkOpYS2tGE/WPr9XuJkirf8rhJlrN2Un2nmvmyWjAYlq5csZEva+b7u+7oDzQwGgULS2kABI30i4uiXou+O/jBd8LQ+RaDUFdd/Z1ghJ+wPLFPKkn0dbAbj9wUV1xV8tQJascJzMn4xgbqpglCMf2CVtyMAg63G9cTSuP8yeGl1LkFZ2uFtRjHrv4gCJ6gXG2kFFbaTg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by TYSPR06MB6768.apcprd06.prod.outlook.com (2603:1096:400:475::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 09:47:57 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 09:47:56 +0000 From: Yangtao Li <frank.li@vivo.com> To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] leds: ip30: Convert to devm_platform_ioremap_resource() Date: Tue, 4 Jul 2023 17:47:45 +0800 Message-Id: <20230704094745.25665-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0046.apcprd02.prod.outlook.com (2603:1096:4:1f5::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYSPR06MB6768:EE_ X-MS-Office365-Filtering-Correlation-Id: 67412af6-bb49-4a99-bfa4-08db7c73be6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HaRPRDIe55UkZVtgK0l2ieVPIWyWn9Y3xC5mrv7sK/6zu248abELvnx/7pCLQCLs5UvdRbbSz8TW43dYe+gmPDMvCaWXVZreoJNyEKZMuLfCiKZnbir0fWQ34dEdE7xIUcVeCTp6h21tynQsQNcP59P5Y/vmLG6XGNNcuM+QJ1h0yey186isGC1yr/AulmYNXR97pFXYOGGK65BfOLEI1n1osh/dSFp+LvrIXnFh4KSv1Db28ZhCYlBjt5Y//EnUTdxdrIHMsg4MX6XsFFHu3VQ0gnwgOewhCUa9MThCXhwtmKNrsHKLxEtkwfVMm3lo3MoOk7pI8sqT4oBXl92YtTIKOc4x1PEGS3UWK75uvvscbkTFlp0B2X1DYDrWrkrJKTrwuKWkHuVziiyt237uCbd4K1vzEQqHmDmytYVwTHACqNn5cur8HslOa3cqzbfZ/J7cfq/+yNZii9iEvMOLtiLnaMc0Vu+a/6/8ydzEYp72vuSUy3UdiNQwR8shOmhMzPkrLcLBFW/RxBcfRRnCBEaff886QDai4tZqeExDa1LeH1XG0PmvJt/9NdKxgOlgthxyQ9UZGS/Dyb+3xWWOVwpISQ+fN9jgS5VFDkAax4Zp16zPqpwy+0t8K1SDlo3I X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199021)(4326008)(316002)(66946007)(66556008)(86362001)(186003)(26005)(6512007)(66476007)(1076003)(6506007)(83380400001)(2616005)(4744005)(2906002)(6486002)(38100700002)(6666004)(52116002)(38350700002)(5660300002)(478600001)(8676002)(110136005)(8936002)(41300700001)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2zvU3lxtI++qMhW80Fu5IKHSDQfgpSh+qG4yV8OTREyxFLXRPCWk/FAAa9SFu9SPUlgr0wl45lzDSz6Djnwoeg++xma/B2pAwQg5etxSIfGC6NL5JeG9s8OpRkHZgLmnJSKW1nFhcjEdAl1nu9eD8S5f5oGN63FIcSObf0v1xzyitTlUIrAGB9YsryU/dXllWrujTFlx8hbA6HzmvCrdjJvbVfPbWmHkGw3M3WpawaAEI0HGSuae14QBGKTbI5w9ZyHqDq2ZIxQSsskHIX1SRKfpNFS/Fy6tk23foPwXpgToaCg0FZjohaFiL+ZQ90UiAu+5CQ86Tf9wGYGYOsAvFj4Hr7ZG6KpcvBHeF4XDvKVuCZFZstXbddWNYzW+n31J93nrJBYvinHePB8heYtz5lI6M3OrWFVgteHjGtTwNEJvu+/NfdzsESNi5Twj71Vk6lVTXnUCf5FxpJlbWuIe4GCm7IWdaIKwd4+YClVrKeqpeZmbwY+ekoToFK+z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vcgt+SgW263IyX X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67412af6-bb49-4a99-bfa4-08db7c73be6b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:47:56.9060 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iX2N6JpLT1Ucdeo0ys0u+x9EW5xdFWUkzWf6HB8VrVOXnUDYg5yWuh8rdgHlngXNr6fxaTANo4zSYSToM2Crkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6768 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770485153428818650?= X-GMAIL-MSGID: =?utf-8?q?1770485153428818650?= |
Series |
leds: ip30: Convert to devm_platform_ioremap_resource()
|
|
Commit Message
李扬韬
July 4, 2023, 9:47 a.m. UTC
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/leds/leds-ip30.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
Comments
On Tue, 04 Jul 2023, Yangtao Li wrote: > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > drivers/leds/leds-ip30.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/leds/leds-ip30.c b/drivers/leds/leds-ip30.c > index 1f952bad0fe8..2df24c303366 100644 > --- a/drivers/leds/leds-ip30.c > +++ b/drivers/leds/leds-ip30.c > @@ -27,22 +27,16 @@ static void ip30led_set(struct led_classdev *led_cdev, > > static int ip30led_create(struct platform_device *pdev, int num) > { > - struct resource *res; > struct ip30_led *data; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, num); > - if (!res) > - return -EBUSY; > - > data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); > if (!data) > return -ENOMEM; > > - data->reg = devm_ioremap_resource(&pdev->dev, res); > + data->reg = devm_platform_ioremap_resource(pdev, num); > if (IS_ERR(data->reg)) > return PTR_ERR(data->reg); > > - You're not supposed to do that. Separate patch in future please. But I cannot review what I do not see! Applied, thanks
diff --git a/drivers/leds/leds-ip30.c b/drivers/leds/leds-ip30.c index 1f952bad0fe8..2df24c303366 100644 --- a/drivers/leds/leds-ip30.c +++ b/drivers/leds/leds-ip30.c @@ -27,22 +27,16 @@ static void ip30led_set(struct led_classdev *led_cdev, static int ip30led_create(struct platform_device *pdev, int num) { - struct resource *res; struct ip30_led *data; - res = platform_get_resource(pdev, IORESOURCE_MEM, num); - if (!res) - return -EBUSY; - data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->reg = devm_ioremap_resource(&pdev->dev, res); + data->reg = devm_platform_ioremap_resource(pdev, num); if (IS_ERR(data->reg)) return PTR_ERR(data->reg); - switch (num) { case IP30_LED_SYSTEM: data->cdev.name = "white:power";