Skip to content

Commit 4edd7dc

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: endpoint: Rename core_init() callback in 'struct pci_epc_event_ops' to epc_init()
core_init() callback is used to notify the EPC initialization event to the EPF drivers. The 'core' prefix was used indicate that the controller IP core has completed initialization. But it serves no purpose as the EPF driver will only care about the EPC initialization as a whole and there is no real benefit to distinguish the IP core part. Rename the core_init() callback in 'struct pci_epc_event_ops' to epc_init() to make it more clear. Link: https://lore.kernel.org/linux-pci/20240430-pci-epf-rework-v4-2-22832d0d456f@linaro.org Tested-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Niklas Cassel <cassel@kernel.org>
1 parent 6859e4f commit 4edd7dc

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

drivers/pci/endpoint/functions/pci-epf-mhi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static void pci_epf_mhi_dma_deinit(struct pci_epf_mhi *epf_mhi)
716716
epf_mhi->dma_chan_rx = NULL;
717717
}
718718

719-
static int pci_epf_mhi_core_init(struct pci_epf *epf)
719+
static int pci_epf_mhi_epc_init(struct pci_epf *epf)
720720
{
721721
struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf);
722722
const struct pci_epf_mhi_ep_info *info = epf_mhi->info;
@@ -897,7 +897,7 @@ static void pci_epf_mhi_unbind(struct pci_epf *epf)
897897
}
898898

899899
static const struct pci_epc_event_ops pci_epf_mhi_event_ops = {
900-
.core_init = pci_epf_mhi_core_init,
900+
.epc_init = pci_epf_mhi_epc_init,
901901
.link_up = pci_epf_mhi_link_up,
902902
.link_down = pci_epf_mhi_link_down,
903903
.bme = pci_epf_mhi_bme,

drivers/pci/endpoint/functions/pci-epf-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ static int pci_epf_test_set_bar(struct pci_epf *epf)
731731
return 0;
732732
}
733733

734-
static int pci_epf_test_core_init(struct pci_epf *epf)
734+
static int pci_epf_test_epc_init(struct pci_epf *epf)
735735
{
736736
struct pci_epf_test *epf_test = epf_get_drvdata(epf);
737737
struct pci_epf_header *header = epf->header;
@@ -791,7 +791,7 @@ static int pci_epf_test_link_up(struct pci_epf *epf)
791791
}
792792

793793
static const struct pci_epc_event_ops pci_epf_test_event_ops = {
794-
.core_init = pci_epf_test_core_init,
794+
.epc_init = pci_epf_test_epc_init,
795795
.link_up = pci_epf_test_link_up,
796796
};
797797

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,9 @@ void pci_epc_linkdown(struct pci_epc *epc)
727727
EXPORT_SYMBOL_GPL(pci_epc_linkdown);
728728

729729
/**
730-
* pci_epc_init_notify() - Notify the EPF device that EPC device's core
731-
* initialization is completed.
732-
* @epc: the EPC device whose core initialization is completed
730+
* pci_epc_init_notify() - Notify the EPF device that EPC device initialization
731+
* is completed.
732+
* @epc: the EPC device whose initialization is completed
733733
*
734734
* Invoke to Notify the EPF device that the EPC device's initialization
735735
* is completed.
@@ -744,8 +744,8 @@ void pci_epc_init_notify(struct pci_epc *epc)
744744
mutex_lock(&epc->list_lock);
745745
list_for_each_entry(epf, &epc->pci_epf, list) {
746746
mutex_lock(&epf->lock);
747-
if (epf->event_ops && epf->event_ops->core_init)
748-
epf->event_ops->core_init(epf);
747+
if (epf->event_ops && epf->event_ops->epc_init)
748+
epf->event_ops->epc_init(epf);
749749
mutex_unlock(&epf->lock);
750750
}
751751
epc->init_complete = true;
@@ -756,7 +756,7 @@ EXPORT_SYMBOL_GPL(pci_epc_init_notify);
756756
/**
757757
* pci_epc_notify_pending_init() - Notify the pending EPC device initialization
758758
* complete to the EPF device
759-
* @epc: the EPC device whose core initialization is pending to be notified
759+
* @epc: the EPC device whose initialization is pending to be notified
760760
* @epf: the EPF device to be notified
761761
*
762762
* Invoke to notify the pending EPC device initialization complete to the EPF
@@ -767,8 +767,8 @@ void pci_epc_notify_pending_init(struct pci_epc *epc, struct pci_epf *epf)
767767
{
768768
if (epc->init_complete) {
769769
mutex_lock(&epf->lock);
770-
if (epf->event_ops && epf->event_ops->core_init)
771-
epf->event_ops->core_init(epf);
770+
if (epf->event_ops && epf->event_ops->epc_init)
771+
epf->event_ops->epc_init(epf);
772772
mutex_unlock(&epf->lock);
773773
}
774774
}

include/linux/pci-epf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ struct pci_epf_ops {
7070

7171
/**
7272
* struct pci_epc_event_ops - Callbacks for capturing the EPC events
73-
* @core_init: Callback for the EPC initialization complete event
73+
* @epc_init: Callback for the EPC initialization complete event
7474
* @link_up: Callback for the EPC link up event
7575
* @link_down: Callback for the EPC link down event
7676
* @bme: Callback for the EPC BME (Bus Master Enable) event
7777
*/
7878
struct pci_epc_event_ops {
79-
int (*core_init)(struct pci_epf *epf);
79+
int (*epc_init)(struct pci_epf *epf);
8080
int (*link_up)(struct pci_epf *epf);
8181
int (*link_down)(struct pci_epf *epf);
8282
int (*bme)(struct pci_epf *epf);

0 commit comments

Comments
 (0)